Chapter 4. Controlling Page Orientation

,

In This Chapter

Image Assigning element Visibility based on page orientation

Image Changing page orientation at runtime

Image Animation using the VisualStateManager

Image Page animation using a custom PhoneApplicationFrame

Image Animating page transitions


Pages in Windows Phone apps can support either the landscape or portrait orientation, or both. When creating a page that supports both orientations, it is prudent to define the UI in XAML in such a way that it produces the layout you want in either orientation without relying on code-beside. Fortunately, XAML’s dynamic layout system makes it easy to build pages that can support both orientations. The Grid and StackPanel elements, for example, resize themselves to inhabit available space when the page orientation changes and the dimensions of the page change.

This chapter begins by exploring the properties and events that govern page orientation. You look at using a custom IValueConverter to hide and display page elements based on the page orientation and at setting the orientation of a page programmatically.

The chapter then looks at animating UI elements when the page orientation changes using the VisualStateManager and examines how to substitute an application’s RootVisual with a custom PhoneApplicationFrame to animate the entire page when the orientation changes.

Finally, the chapter looks at animating page transition using the Windows Phone Toolkit.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.22.216