Adapting to views using css or js
using css
@media screen and (-ms-view-state: fullscreen-landscape) { } @media screen and (-ms-view-state: fullscreen-portrait) { } @media screen and (-ms-view-state: filled) { } @media screen and (-ms-view-state: snapped) { }
using js:
(function () { "use strict"; var app = WinJS.Application; var view = Windows.UI.ViewManagement; app.onactivated = function (eventObject) { var value = getMessageFromView(view.ApplicationView.value); }; function getMessageFromView(currentView) { var displayMsg; switch (currentView) { case view.ApplicationViewState.filled: displayMsg = "Filled View"; break; case view.ApplicationViewState.snapped: displayMsg = "Snapped View"; break; case view.ApplicationViewState.fullScreenLandscape: displayMsg = "Full - Landscape"; break; case view.ApplicationViewState.fullScreenPortrait: displayMsg = "Full - Portrait"; break; } return displayMsg; } app.start(); })();