Trying to make a scrollview zoom out in a windows store app triggered by the double tapped event.
this is the code where it's supposed to happen
private void MainPhotoDisplay_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
{
MainPhotoDisplayscrollViewer.ChangeView(null, null, 1.0F,true);
}
but if I zoom in, in the simulator and then double tap, nothing happens. the event does fire and the method is run but nothing happens, the view remains in the zoomed in state.
here is the documentation for it: http://msdn.microsoft.com/en-us/library/windows/apps/dn252762.aspx
this obsolete method:
MainPhotoDisplayscrollViewer.ZoomToFactor(1);
works just fine, but sadly it has no animation which makes for a bad user experience. And is not really what I want.
any ideas as to why nothing happens?
Another solution is to add a Task.Delay
call before the instruction.
Really weird but it works.
await Task.Delay(1);
scroller.ChangeView(null, null, null, false); // whatever
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