public void RefreshFrame() { RefreshableFrameInterface currentpane = MainFrame.Content as RefreshableFrameInterface; if (currentpane != null) { var page_param = currentpane.getPageParameter(); MainFrame.Navigate(MainFrame.CurrentSourcePageType, currentpane.getPageParameter()); MainFrame.BackStack.Remove(MainFrame.BackStack.Last()); if (MainFrame.BackStackDepth > 0) { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; } else { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; } } }
public MainPage() { configureHttpClient(); vault = new PasswordVault(); loggedIn = false; tryLogin(); SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; this.InitializeComponent(); if (MainFrame.ContentTransitions == null) { MainFrame.ContentTransitions = new TransitionCollection(); } MainFrame.ContentTransitions.Clear(); MainFrame.ContentTransitions.Add(new EntranceThemeTransition() { IsStaggeringEnabled = true }); MainFrame.Navigated += (e, f) => { RefreshableFrameInterface currentpane = MainFrame.Content as RefreshableFrameInterface; if (currentpane != null) { currentpane.loadedAction(() => { if (currentpane.multipleSupported()) { SelectMultipleButton.Visibility = Visibility.Visible; } else { SelectMultipleButton.Visibility = Visibility.Collapsed; } if (currentpane.isRefreshable()) { RefreshButton.Visibility = Visibility.Visible; } else { RefreshButton.Visibility = Visibility.Collapsed; } MainPageTitle.Text = currentpane.getTitleText(); if (MainFrame.BackStackDepth > 0) { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; } else { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; } }); } }; if (loggedIn) { generateVideoFrame(VidmeUrlClass.FeedVideoURL, "Home", clearStack); } else { generateVideoFrame(VidmeUrlClass.FeaturedVideoURL, "Home", clearStack); } //PC customization if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.ApplicationView")) { ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; if (titleBar != null) { titleBar.ButtonBackgroundColor = (Application.Current.Resources["ApplicationTheme_DarkAccent"] as SolidColorBrush).Color; titleBar.ButtonForegroundColor = (Application.Current.Resources["ApplicationTheme_Highlight"] as SolidColorBrush).Color; titleBar.BackgroundColor = (Application.Current.Resources["ApplicationTheme_DarkAccent"] as SolidColorBrush).Color; titleBar.ForegroundColor = (Application.Current.Resources["ApplicationTheme_Highlight"] as SolidColorBrush).Color; //titleBar.ButtonBackgroundColor = Colors.Transparent; CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar; coreTitleBar.ExtendViewIntoTitleBar = false; } } }