Setting Page Orientation at Runtime

As you saw in the previous section, the Orientation property of the PhoneApplicationPage class cannot be assigned at runtime. Another approach is required to change the page orientation. For this turn to the SupportedOrientations property, which is assignable at runtime.

To recap, the SupportedOrientations property defines the allowed orientation or orientations of the page, which can be Portrait, Landscape, or PortraitOrLandscape.

Setting the SupportedOrientations property to the desired orientation forces the page to be shown in that orientation. For example, if the page is being viewed in portrait orientation, and you want to change the page orientation to landscape, you can set the SupportedOrientations ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.