1 out of 3 rated this helpful - Rate this topic

ApplicationView.Value | value property

Gets the state of the current app view.

Syntax


var value = Windows.UI.ViewManagement.ApplicationView.value;

Property value

Type: ApplicationViewState

The current state of the running app's view. This state indicates the orientation (landscape or portrait) and whether or not the app is snapped.

Remarks

To respond to a view state change, an app queries this property from inside the app window resize event handler to determine how to layout the app in the changed view state.


function onLoad() {
    // Register for the window resize event
    window.addEventListener("resize", onSizeChanged);
}

function onSizeChanged() {
    // Get view state
    var currentViewState = ApplicationView.value;

    if (currentViewState == ApplicationViewState.fullScreenLandscape) {
        // Full screen Landscape

    } else if (currentViewState == ApplicationViewState.fullScreenPortrait) {
        // Full screen Portrait

    } else if (currentViewState == ApplicationViewState.filled) {
         // Filled

    } else if (currentViewState == ApplicationViewState.snapped) {
        // Snapped
    } 
}

...
document.addEventListener("DOMContentLoaded", onLoad, false);


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Namespace

Windows.UI.ViewManagement
Windows::UI::ViewManagement [C++]

Metadata

Windows.winmd

See also

ApplicationView
Snap sample

 

 

Build date: 2/25/2013

© 2013 Microsoft. All rights reserved.