Animating the Entire Page When Orientation Changes
While animating UIElements
is performed within the page, to animate the page itself requires implementation of a custom PhoneApplicationFrame
. This is achieved by subclassing the PhoneApplicationFrame
class, and then subscribing to the frame’s OrientationChanged
event to initiate the animation.
To replace your application’s standard PhoneApplicationFrame
with a custom frame, modify the App
class, either in XAML or in the code-beside, to use the custom frame as the application’s RootVisual
.
The following excerpt shows how the App.xaml file can be modified to use a custom PhoneApplicationFrame
:
<Application.RootVisual> <unleashed:AnimateOrientationChangesFrame
Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.