Delay's Blog is the blog of David Anson, a Microsoft developer who works with the Silverlight, WPF, Windows Phone, and web platforms.
http://dlaa.me/
@DavidAns
I've written about how my DynamicOrientationChanges classes improve the user experience for Windows Phone 7 applications by animating device orientation changes. For "in your face" transitions, there's AnimateOrientationChangesFrame which animates the rotation interactively (but might get bogged down by complex layouts). For more subtle transitions that perform smoothly regardless of how complex the page layout is, there's FadeOrientationChangesFrame which fades between the before/after layouts. Both classes have the same API and both are used in the same manner - it's just a matter of choosing the right one for your scenario.
AnimateOrientationChangesFrame
FadeOrientationChangesFrame
The purpose of this post is to let readers know I've just updated the source code and pre-compiled DynamicOrientationChanges.dll assembly with two fixes for AnimateOrientationChangesFrame:
DynamicOrientationChanges.dll
TextBox
Neither of these issues affected FadeOrientationChangesFrame (its simpler implementation is its advantage), so that code hasn't changed since last time.
Aside: I'd like to thank kind readers Mike Calligaro (yes, the same Mike who found an issue last time!) and Tonci Tonci for reporting the landscape and SIP issues (respectively) and for trying out proposed fixes to verify their correctness. (Of course, any problems are entirely my fault.)
[Click here to download the DynamicOrientationChanges sample and pre-compiled assembly for the Windows Phone 7 platform.]
The steps for adding a rotation/fade animation to a new application remain the same as before:
SupportedOrientations="Portrait"
SupportedOrientations="PortraitOrLandscape"
Add the AnimateOrientationChangesFrame.cs or FadeOrientationChangesFrame.cs source code file from the sample to your project/solution.
AnimateOrientationChangesFrame.cs
FadeOrientationChangesFrame.cs
-OR-
Add a reference to the pre-compiled DynamicOrientationChanges.dll assembly from the sample download to your project/solution.
App.xaml.cs
RootFrame
InitializePhoneApplication
Phone application initialization
RootFrame = new PhoneApplicationFrame();
RootFrame = new Delay.AnimateOrientationChangesFrame();
RootFrame = new Delay.FadeOrientationChangesFrame();
Duration
EasingFunction
IsAnimationEnabled