Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable the arrows on a FlipView?

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

like image 424
Sheehan Alam Avatar asked Dec 20 '22 17:12

Sheehan Alam


2 Answers

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.

like image 180
Filip Skakun Avatar answered Jan 06 '23 03:01

Filip Skakun


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

like image 31
Artemious Avatar answered Jan 06 '23 02:01

Artemious