Automatic Orientation support on phone 7 with xaml
Windows phone 7 comes with a support of xaml. Xaml lets you easily create layout that automatically fits your screen as per the screen size and form factor. Learn how to create automatic orientation support on phone 7.
With the support of xaml in windows phone 7, it is easier to creae multi-orientation portrait and landscape UI. Lets check it out. We will use Grid layout technique to achieve this. Columns and rows that are defined within a Grid can take advantage of Star sizing to distribute remaining space proportionally. To focus on the Orientation feature I am continuing on the application created on this article.
See the SupportedOrientation property. SupportedOrientation has 3 values. 1. Portrait 2. Orientation 3. PortraitOrOrientation Setting to PortraitOrOrientation makes your UI rotate and adjusts your layout when you rotate your phone. WPF framework automatically detects your phone orientation and rotates your layout. Now we just have to use the Star(*) sizing of the Grid layout. See the result below.
Portrait Orientation
Landscape Orientation