public void ChangeViewState() { if (App.isLandscape() || App.isPortrait()) { this.TimeControl.ShowTime(); this.btnBack.Visibility = Windows.UI.Xaml.Visibility.Collapsed; //this.btnBack.Margin = new Thickness(36, 12, 36, 0); if (crumbs != null) { this.SetupBreadcrumbs(crumbs, false); } } else if (App.isSnapped()) { this.TimeControl.HideTime(); this.btnBack.Visibility = Windows.UI.Xaml.Visibility.Visible; this.btnBack.Margin = new Thickness(10, 12, 15, 0); if (crumbs != null) { List <Breadcrumb> newList = new List <Breadcrumb>(); newList.Add(crumbs[crumbs.Count - 1]); this.SetupBreadcrumbs(newList, false); } } }
public void ChangeViewState() { if (App.isLandscape() || App.isPortrait()) { this.LandscapeContent.Visibility = Visibility.Visible; this.LandscapeContentSnapped.Visibility = Visibility.Collapsed; } else if (App.isSnapped()) { if (this.LandscapeContentSnapped.ItemTemplate != null && this.LandscapeContentSnapped.ItemContainerStyle != null) { this.LandscapeContent.Visibility = Visibility.Collapsed; this.LandscapeContentSnapped.Visibility = Visibility.Visible; } else { this.LandscapeContent.Visibility = Windows.UI.Xaml.Visibility.Collapsed; this.LandscapeContentSnapped.Visibility = Windows.UI.Xaml.Visibility.Collapsed; } } else { this.LandscapeContent.Visibility = Visibility.Visible; this.LandscapeContentSnapped.Visibility = Visibility.Collapsed; } }
void MainPage_ViewStateChanged() { title.ChangeViewState(); this.MainScape.ChangeViewState(); if (App.isLandscape() || App.isPortrait()) { VisualStateManager.GoToState(this, "Full", false); this.title.Margin = new Thickness(0, 0, 0, 0); this.MainScape.Margin = new Thickness(0, 48, 0, 0); } else if (App.isSnapped()) { VisualStateManager.GoToState(this, "Snapped", false); this.title.Margin = new Thickness(0, 0, 0, 0); this.MainScape.Margin = new Thickness(8, 48, 0, 0); } }