how to disable default (next/prev) buttons of flip in winrt xaml

五迷三道 提交于 2019-12-11 19:41:43

问题


i am working on winrt flipview. in this i want to disable its default next and prev buttons of FlipView. but the fliping can be done by another buttons. can any one please tell me how to disable default(next/prev) buttons in winrt xaml


回答1:


You would need to re-template the control and remove those elements.




回答2:


There are 2 options.

Option 1. In FlipView.Loaded event dynamically remove the arrow buttons.

private void flipView_Loaded(object sender, RoutedEventArgs e)
{
    Grid grid = (Grid)VisualTreeHelper.GetChild(flipView, 0);
    for (int i = grid.Children.Count - 1; i >= 0; i--)
        if (grid.Children[i] is Button)
            grid.Children.RemoveAt(i);
}

Option 2. Retemplate the FlipView control (as Tim Heuer stated in his answer).



来源:https://stackoverflow.com/questions/18216402/how-to-disable-default-next-prev-buttons-of-flip-in-winrt-xaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!