How can I disable the arrows on a FlipView?

不羁的心 提交于 2019-12-23 13:32:11

问题


I have a FlipView, which is working great, but I'd like to disable the < and > arrows that fade in while scrolling.


回答1:


I think that would break the scenario for keyboard/mouse users, no?

You could remove the buttons from the control template if you really need to.




回答2:


Here 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. Edit the template of the FlipView control (as Filip Skakun said in his answer).



来源:https://stackoverflow.com/questions/11906073/how-can-i-disable-the-arrows-on-a-flipview

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