The default portrait mode for the Silverlight project of WP7 and the default xNa project is Landscape mode. To change the initial mode, you can change the supportedorientations attribute on the phoneapplicationpage.
The supportedorientations attribute has three enumerated values: Landscape (horizontal direction supported), portrait (vertical direction supported), and portraitorlandscape (horizontal and vertical direction supported ).
You can also use vs to add a horizontal or vertical page.
To respond to screen changes, the UI can handle the changes through the orientationchanged event of phoneapplicationpage, and determine the direction of the current mobile phone through the orientationchangedeventsargs type parameter E's orientation value. The value of orientation is the enumerated value of pageorientation.
The following table lists the definitions of pageorientation enumeration:
// Summary: // an enumeration defining the possible orientations of a page. public Enum pageorientation {// Summary: // No orientation is specified. none = 0, // Summary: // portrait orientation. portrait = 1, // Summary: // landscape orientation. landscape = 2, // Summary: // portrait orientation. portraitup = 5, // Summary: // portrait orientation. portraitdown = 9, // Summary: // landscape orientation with the top of the page rotated to the left. landscapeleft = 18, // Summary: // landscape orientation with the top of the page rotated to the right. landscaperight = 34,}