public PageOne() { this.InitializeComponent(); Debug.WriteLine(string.Format("Creating: {0}", GetType().Name)); ViewModel = new PageOneViewModel(NestedNavigationServiceProvider.GetNavigationService()); }
protected override void OnLaunched(LaunchActivatedEventArgs e) { var mainPage = Window.Current.Content as MainPage; if (mainPage == null) { mainPage = new MainPage(); if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } Window.Current.Content = mainPage; NestedNavigationServiceProvider.GetNavigationService().Navigated += OnNavigated; SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; SetBackButtonVisibility(); } Window.Current.Activate(); }
private void SetBackButtonVisibility() { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = NestedNavigationServiceProvider.GetNavigationService().CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed; }
private void OnBackRequested(object sender, BackRequestedEventArgs e) { NestedNavigationServiceProvider.GetNavigationService().GoBack(); }