WindowsPhoneGeek

WPAppInfo

Login | Join (Why?)

rss rss rss
logo

Orientation and Behaviours in WP7

2/8/2012

source: buildmobile.com

As I've pointed out in a number of previous posts, one of the things that sets Windows Phone development apart from other mobile platforms is the awesome set of tools we have to work with. In this post we're going to look at how you can handle the different phone orientations by defining different layouts in Expression Blend.

Let's get started with a new Windows Phone Application. My preference is to create the new project in Visual Studio, and then immediately flip over to Expression Blend. Since we want our page to respond to orientation changes of the device, we need to change the SupportedOrientations property to PortraitOrLandscape. This can be set in the Properties window for the PhoneApplicationPage.

Locate the States window (if it's not visible, you can display it via the Window menu). Initially your page won't have any states or state groups defined, so the first thing to do is to create a new state group by clicking the Add state group icon. We're going to call the state group OrientationStates as it's going to include the different visual states, in other words the different layouts, for the different orientations of the page.

...Read more

You can also follow us on Twitter @winphonegeek

Comments

Add comment to 'Orientation and Behaviours in WP7'

Comment

New! WindowsPhoneGeek Component Marketplace

Our Top Articles & Free books

Our Top Tips & Samples