HTML and CSS Reference
In-Depth Information
Since Windows 8 is an operating system created from the ground up to run on devices of different
sizes, the whole theme of adapting the user interface (and subsequently the user experience) to a
different screen is topical.
Windows 8 defines a few view states for applications and Windows Store applications receive
proper notifications when the view state changes. What happens next is up to the application. Let's
find out more about the predefined view states.
Full-screen view states
An application that runs in full-screen mode takes up the entire screen. Unless specified differently
during the startup of the application, this is the default view state of any Windows Store application.
To be precise, Windows 8 defines two full-screen modes—one for each orientation of the device.
Landscape mode
The landscape mode indicates that the device is being held horizontally and that width is larger than
height. The landscape mode can be programmatically detected by looking at the value returned by
the Windows.UI.ViewManagement.ApplicationViewState object. The following code snippet shows
how to detect the landscape mode:
// Grab the current view state
var currentState = Windows.UI.ViewManagement.ApplicationView.value;
// Verify if the app is running in full-screen landscape mode
if (currentState === Windows.UI.ViewManagement.ApplicationViewState.
fullScreenLandscape) {
...
}
The operating system detects rotation of the device and automatically flips the user interface and
notifies the application of any change.
portrait mode
The portrait mode indicates that the available screen height now is larger than the width. This
resolution suggests that it could be preferable for the application to flow content vertically because
there's both more room to fill and the user may find it easier to scroll down rather than swipe left.
The following code snippet shows how to detect the portrait mode:
// Grab the current view state
var currentState = Windows.UI.ViewManagement.ApplicationView.value;
// Verify if the app is running in full-screen portrait mode
if (currentState === Windows.UI.ViewManagement.ApplicationViewState.
Search WWH ::




Custom Search