Gets the current orientation of a rectangular monitor.
Syntax
var currentOrientation = Windows.Graphics.Display.DisplayProperties.currentOrientation;
Property value
Type: DisplayOrientations
The current orientation of a rectangular monitor.
Remarks
The value of the DisplayProperties.CurrentOrientation property corresponds to the orientation of the display or monitor and not necessarily to the orientation of your app. To determine the orientation of your app for layout purposes, use the ApplicationView.Value property.
Examples
void MainPage::Page_OrientationChanged(Object^ sender) { if (DisplayProperties::CurrentOrientation == DisplayOrientations::Portrait || DisplayProperties::CurrentOrientation == DisplayOrientations::PortraitFlipped) { VisualStateManager::GoToState(this, "Portrait", false); } }
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 2/25/2013