I am trying to change the layout of my listView control from "GridView" to "ListView" when application gets snapped. Of course, it should return to "GridView" in any other state. I wrote some code, but it doesn't work, so I wonder why...
This is the code I've written:
var viewState = Windows.UI.ViewManagement.ApplicationView;
var list = document.getElementById("messageDisplay").winControl;
if (viewState == Windows.UI.ViewManagement.ApplicationViewState.snapped) {
list.layout = new WinJS.UI.ListLayout();
}
else
{
list.layout = new WinJS.UI.GridLayout();
}