HTML and CSS Reference
In-Depth Information
SnapMeApp.getViewStateForDisplay = function () {
var viewState = Windows.UI.ViewManagement.ApplicationView.value;
switch (viewState) {
case Windows.UI.ViewManagement.ApplicationViewState.snapped:
return "I'm snapped now!";
case Windows.UI.ViewManagement.ApplicationViewState.filled:
return "I'm filled now!";
case Windows.UI.ViewManagement.ApplicationViewState.fullScreenLandscape:
return "I'm full screen landscape now!";
case Windows.UI.ViewManagement.ApplicationViewState.fullScreenPortrait:
return "I'm full screen portrait now!";
}
}
You're now ready to compile the sample application. Figure 8-5 shows what you get: the
application is initially launched in full-screen landscape mode. Note that on a device held in portrait
mode when the application is launched, you would get a different view state value—full-screen
portrait.
FIGURE 8-5 The SnapMe application in landscape mode.
It is interesting to note that Microsoft Visual Studio has a simulator with built-in functions to
experiment with orientation. Figure 8-6 shows how to change the orientation in the simulator to test
if the portrait mode is detected correctly by the SnapMe application.
Search WWH ::




Custom Search