Windows Phone 7 for Silverlight Developers: Portrait and Landscape & Themes - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Wednesday, July 20, 2011

Windows Phone 7 for Silverlight Developers: Portrait and Landscape & Themes

Portrait and Landscape

While you rarely rotate your desktop or even laptop monitor, a phone naturally supports both Portrait and Landscape modes. The current orientation can be read using the PhoneApplicationPage.Orientation property. It returns one of the PageOrientation enumeration values: None, Portrait, Landscape, PortraitUp, PortraitDown, LandscapeLeft, LandscapeRight.

If you want to programmatically set the orientation of the page, you can set the SupportedOrientations property of the PhoneApplicationPage class to Portrait, Landscape or PortraitOrLandscape. In the latter case, the UI will automatically rotate based on the input from the accelerometer. Combined with the advanced layout features of Silverlight, you can create an UI that adheres to the layout changes without having to write a single line of code. See Figure 14 for an example from the app "Guitar Tuner".

Read More....

No comments:

Post a Comment