本文整理汇总了C#中PageOrientation.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PageOrientation.ToString方法的具体用法?C# PageOrientation.ToString怎么用?C# PageOrientation.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageOrientation
的用法示例。
在下文中一共展示了PageOrientation.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetVisualStateName
private static String GetVisualStateName(PageOrientation orientation)
{
return orientation.ToString();
}
示例2: MainPage_OrientationChanged
// Handle orientation changes
void MainPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
{
_to = e.Orientation;
if (_from == PageOrientation.None)
_from = _to;
System.Diagnostics.Debug.WriteLine("From: " + _from.ToString());
System.Diagnostics.Debug.WriteLine("To: " + _to.ToString());
// If in portrait mode...
if ((e.Orientation & PageOrientation.Portrait) == (PageOrientation.Portrait))
{
overlay.LayoutRoot.Height = Browser.Height = Application.Current.Host.Content.ActualHeight - ApplicationBar.DefaultSize;
overlay.LayoutRoot.Width = Browser.Width = Application.Current.Host.Content.ActualWidth;
}
// If in landscape mode...
else
{
overlay.LayoutRoot.Height = Browser.Height = Application.Current.Host.Content.ActualWidth;
overlay.LayoutRoot.Width = Browser.Width = Application.Current.Host.Content.ActualHeight - ApplicationBar.DefaultSize;
}
switch (_from)
{
case PageOrientation.PortraitUp:
switch (_to)
{
case PageOrientation.LandscapeLeft:
RotateAnimation.From = -90;
break;
case PageOrientation.LandscapeRight:
RotateAnimation.From = 90;
break;
case PageOrientation.PortraitDown:
RotateAnimation.From = 180;
break;
}
break;
case PageOrientation.LandscapeLeft:
switch (_to)
{
case PageOrientation.PortraitUp:
RotateAnimation.From = 90;
break;
case PageOrientation.PortraitDown:
RotateAnimation.From = -90;
break;
case PageOrientation.LandscapeRight:
RotateAnimation.From = 180;
break;
}
break;
case PageOrientation.LandscapeRight:
switch (_to)
{
case PageOrientation.PortraitUp:
RotateAnimation.From = -90;
break;
case PageOrientation.PortraitDown:
RotateAnimation.From = 90;
break;
case PageOrientation.LandscapeLeft:
RotateAnimation.From = 180;
break;
}
break;
case PageOrientation.PortraitDown:
switch (_to)
{
case PageOrientation.PortraitUp:
RotateAnimation.From = 180;
break;
case PageOrientation.LandscapeRight:
RotateAnimation.From = -90;
break;
case PageOrientation.LandscapeLeft:
RotateAnimation.From = 90;
break;
}
break;
}
RotateAnimation.To = 0;
RotateStoryboard.Begin();
_from = _to;
}