How can I disable the arrows on a FlipView?

2019-06-28 01:03发布

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

2条回答
够拽才男人
2楼-- · 2019-06-28 01:31

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).

查看更多
仙女界的扛把子
3楼-- · 2019-06-28 01:38

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.

查看更多
登录 后发表回答