public MainPage()
{
this.InitializeComponent();
SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;
this.DataContext = Data;
this.SizeChanged += (s, args) =>
{
PageSizeChanged();
};
}
void PageSizeChanged()
{
String state = (mainPage.ActualWidth > 750) ? "PrimaryView" : "Snapped";
VisualStateManager.GoToState(this, state, false);