DisplayProperties.CurrentOrientation | currentOrientation property

0 out of 1 rated this helpful - Rate this topic

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

Windows.Graphics.Display
Windows::Graphics::Display [C++]

Metadata

Windows.winmd

See also

DisplayProperties

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.