I have an application under development where I am showing an enlarged, detailed view of an image from a GridView collection.
The user clicks on the image in the GridView and its displayed on its own page, initially sized to the containing ScrollViewer.
I am using connected animation to transition the image from the GridView to the detail view.
My problem is that the animation will run before the image is resized to the size of the ScrollViewer.
The animation runs and shows the image full size, it then resizes the image to the ScrollViewer after the animation has completed. The Zoom factor is set to 1 as if its displaying a full size image.
I call ScrollViewer.ChangeView() from the Scrollviewer Loaded event handler.
If I try to call ChangeView() any time before the ScrollViewer Loaded event, the size of the ScrollViewer is unknown.
The animation is run, (animation.TryStart) from the detail view OnNavigatedTo event.
I want the image to be resized as the detail view Page is resized. If the user wants to show an enlarged view of the image, I need scroll bars to be displayed, hence the need for a ScrollViewer.
I am also trying to handle the case where an image may have a longer height than width.
The code for this demo is on github:
TransitionDemo