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 |
|
|
Metadata |
|
See also
Build date: 2/25/2013
