WP7屏幕方向

屏幕方向orientation,竖屏Portrail,横屏Langscape,支持的屏幕方向 SupportedOrientations="PortraitOrLandscape"  

启动的屏幕方向Orientations="Portrait" 

OrientationChange事件重写

 public About()        

{           

 InitializeComponent();    

 OrientationChanged += new EventHandler<OrientationChangedEventArgs>(About_OrientationChanged);        

}
 void About_OrientationChanged(object sender, OrientationChangedEventArgs e)       

 {           

 if (e.Orientation == PageOrientation.LandscapeLeft || e.Orientation== PageOrientation.LandscapeRight)           

 {                

TitlePanel.Visibility = Visibility.Collapsed;      //横屏不可见           

 }            

else if (e.Orientation == PageOrientation.PortraitDown || e.Orientation== PageOrientation.PortraitUp)           

 {                

TitlePanel.Visibility = Visibility.Visible;       //竖屏可见    

 }

你可能感兴趣的:(wp7)