1 There are two ways to change the orientation of the device:
(1) Set Supportedorientation to "Portraitorlandscape" to allow the operating system to be implemented for you.
(2) is implemented by code: Orientationchanged event.
1 This New Eventhandler<orientationchangedeventargs> (mainpage_orientationchanged);
1 voidMainpage_orientationchanged (Objectsender, Orientationchangedeventargs e)2 { 3 if((e.orientation = = pageorientation.landscaperight) | | (E.orientation = =pageorientation.landscapeleft))4 { 5Titlepanel.visibility =visibility.collapsed; 6 } 7 Else if((e.orientation = = Pageorientation.portraitdown) | | (E.orientation = =pageorientation.portraitup))8 { 9Titlepanel.visibility =visibility.visible; Ten } One } A}
2 System Themes
Right-click the project in Visual Studio and select "Open in Expression Blend ..." or select "Open in Expression Blend ..." In the View menu.
There is a tag called "Device" in the UI of blend, which looks like this:
<Gridx:name= "LayoutRoot"Background= "Transparent"> <grid.rowdefinitions> <RowDefinitionHeight= "Auto"/> <RowDefinitionHeight="*"/> </grid.rowdefinitions> <!--Titlepanel contains the name of the application and page title - <RectangleStroke= "Black"Grid.rowspan= "2"> <Rectangle.fill> <LinearGradientBrushEndPoint= "0.5,1"StartPoint= "0.5,0"> <GradientStopColor= "{StaticResource Phonebackgroundcolor}"Offset= "0"/> <GradientStopColor= "{StaticResource Phoneaccentcolor}"Offset= "1"/> </LinearGradientBrush> </Rectangle.fill> </Rectangle> <!--Titlepanel contains the name of the application and page title - <StackPanelx:name= "Titlepanel"Grid.Row= "0"Margin= "12,17,0,28"> <TextBlockx:name= "Applicationtitle"Text= "Blankensoft"Style= "{StaticResource Phonetextnormalstyle}"Mce_style= "{StaticResource Phonetextnormalstyle}"/> <TextBlockx:name= "PageTitle"Text= "System theming"Margin= "9,-7,0,0"Style= "{StaticResource Phonetexttitle1style}"Mce_style= "{StaticResource Phonetexttitle1style}"> <Textblock.foreground> <SolidColorBrushColor= "{StaticResource Phoneaccentcolor}"/> </Textblock.foreground> </TextBlock> </StackPanel> <!--contentpanel-place Additional content here - <Gridx:name= "Contentpanel"Grid.Row= "1"Margin= "12,0,12,0"> <TextBlockHeight= "601"textwrapping= "Wrap"HorizontalAlignment= "Left"Margin= "0,6,0,0"x:name= "TextBlock1"Text= "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis turpis sit amet diam elementum molestie. Cras quis massa ante. Morbi sit amet arcu quam, non dignissim nibh. Nunc lectus Leo, ornare quis imperdiet ID, Fringilla vel diam. Proin vitae augue non sem sollicitudin imperdiet ut quis di Am. Nulla Vitae Nulla eros. Curabitur mauris justo, eleifend eu sodales AC, blandit vitae mauris. Pellentesque erat lorem, euismod at sodales eget, sollicitudin sed velit. Praesent est sapien, hendrerit tempor tincidunt quis, posuere ac nunc. Nam odio nisl, feugiat eget blandit sit amet, Dapibus ID tellus. Sed blandit nisi nunc. Aliquam fermentum justo tristique risus Porta Sollicitudin. Aenean aliquam congue ornare. Curabitur blandit mi quis odio convallis adipiscing. "VerticalAlignment= "Top"Width= "468" /> </Grid> </Grid>
3 system Tray
Shell:SystemTray.IsVisible
Windows Phone 7 Programming Learning bit two-device orientation, system theme and system tray