The Windows Dev Center states regarding the UseTouchAnimationsForAllNavigation
property:
The XAML FlipView control supports three modes of navigation; touch-based, button-based and programmatic. When a user navigates by touch, the FlipView items scroll smoothly into view. When you set this property to true, the same navigation animation occurs whether the navigation is touch-based, button-based and programmatic.
I'm currently navigating from my page's code behind by assigning the SelectedItem
property of the FlipView:
FlipView.SelectedItem = FlipView.Items.Last();
However, the swipe animation does not show. How can I enable it?
Meanwhile, I was able to solve this problem. I have a button that triggers the navigation to the next FlipViewItem. This button however was placed in a FlipViewItem.
With my setup (touch device), nothing happend. Then I tried clicking the button with the mouse and it worked. After I disabled UseTouchAnimationsForAllNavigation
, it also worked using touch input. In my tests, I placed the button outside of the FlipView and it did work using animations.
Here's the problem: When tapping the button, the navigation animation tries to start (SelectedIndex
is set correctly), but stopped because the user blocks the animation by still touching the button. So, the navigation is cancelled and SelectionChanged
reports the current page.
The solution is to set ManipulationMode
of the Button to All
. After that, you can't flip the FlipViewItem when touching the button, but the animation executes and it works like charm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With