public INavigationService CreateNavigationService(WinRTContainer container) { var navigationService = container.RegisterNavigationService(shellFrame); navigationViewHeaderBehavior.Initialize(navigationService); return(navigationService); }
protected override void PrepareViewFirst(Frame rootFrame) { try { //Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter //rootFrame.Navigate(typeof(HelloView)); } _container.RegisterNavigationService(rootFrame); } catch (Exception exception) { _log.Error(exception); throw; } }
public async void SetupNavigationService(object sender, RoutedEventArgs e) { _navigationService = _container.RegisterNavigationService((Frame)sender); await LoadResources(); NavigateToMainView(); }
public void RegisterFrame(Frame frame) { MarkedUp.AnalyticClient.RegisterNavigationFrame(frame); container.RegisterNavigationService(frame); navigationService = container.GetInstance <INavigationService>(); }
public void SetupNavigationService(Frame frame) { _navigationService = _container.RegisterNavigationService(frame); if (_resume) { _navigationService.ResumeState(); } }
public async Task ActivateAsync(object activationArgs) { if (IsInteractive(activationArgs)) { // Initialize services that you need before app activation // take into account that the splash screen is shown while this code runs. await InitializeAsync(); // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (Window.Current.Content == null) { // Create a Shell or Frame to act as the navigation context if (_shell?.Value == null) { var frame = new Frame(); NavigationService = _container.RegisterNavigationService(frame); Window.Current.Content = frame; } else { var viewModel = ViewModelLocator.LocateForView(_shell.Value); ViewModelBinder.Bind(viewModel, _shell.Value, null); ScreenExtensions.TryActivate(viewModel); NavigationService = _container.GetInstance <INavigationService>(); Window.Current.Content = _shell?.Value; } } } var activationHandler = GetActivationHandlers() .FirstOrDefault(h => h.CanHandle(activationArgs)); if (activationHandler != null) { await activationHandler.HandleAsync(activationArgs); } if (IsInteractive(activationArgs)) { var defaultHandler = new DefaultActivationHandler(_defaultNavItem, NavigationService); if (defaultHandler.CanHandle(activationArgs)) { await defaultHandler.HandleAsync(activationArgs); } // Ensure the current window is active Window.Current.Activate(); // Tasks after activation await StartupAsync(); } }
public void RegisterFrame(Frame frame) { container.RegisterNavigationService(frame); navigationService = container.GetInstance <INavigationService>(); navigationService.Navigated += (s, e) => NotifyOfPropertyChange(nameof(CanGoBack)); navigationService.NavigateToViewModel <MenuViewModel>(); }
public async Task ActivateAsync(object activationArgs) { if (IsInteractive(activationArgs)) { // Initialize things like registering background task before the app is loaded await InitializeAsync(); // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (Window.Current.Content == null) { // Create a Frame to act as the navigation context and navigate to the first page if (_shell?.Value == null) { var frame = new Frame(); NavigationService = _container.RegisterNavigationService(frame); Window.Current.Content = frame; } else { var viewModel = ViewModelLocator.LocateForView(_shell.Value); ViewModelBinder.Bind(viewModel, _shell.Value, null); ScreenExtensions.TryActivate(viewModel); NavigationService = _container.GetInstance <INavigationService>(); Window.Current.Content = _shell?.Value; } } } var activationHandler = GetActivationHandlers() .FirstOrDefault(h => h.CanHandle(activationArgs)); if (activationHandler != null) { await activationHandler.HandleAsync(activationArgs); } if (IsInteractive(activationArgs)) { var defaultHandler = new DefaultLaunchActivationHandler(_defaultNavItem, NavigationService); if (defaultHandler.CanHandle(activationArgs)) { await defaultHandler.HandleAsync(activationArgs); } // Ensure the current window is active Window.Current.Activate(); // Tasks after activation await StartupAsync(); } }
protected override void PrepareViewFirst(Frame rootFrame) { _container.Instance(rootFrame); _container.RegisterNavigationService(rootFrame); _events = _container.GetInstance <IEventAggregator>(); var messages = new GlobalMessagesService(); _events.Subscribe(messages); _container.Instance(messages); }
protected override void PrepareViewFirst(Frame rootFrame) { var navigationService = container.RegisterNavigationService(rootFrame); var navigationManager = SystemNavigationManager.GetForCurrentView(); navigationService.Navigated += (s, e) => { navigationManager.AppViewBackButtonVisibility = navigationService.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed; }; }
public void SetupNavigationService(Frame frame) { navigationService = container.RegisterNavigationService(frame); if (resume) { navigationService.ResumeState(); } else { navigationService.For <TestViewModel>().Navigate(); } }
public void SetupNavigationService(Frame frame) { if (_container.HasHandler(typeof(INavigationService), null)) { _container.UnregisterHandler(typeof(INavigationService), null); } this._navigationService = _container.RegisterNavigationService(frame); this._navigationService.Navigated += _navigationService_Navigated; this._navigationService.NavigationFailed += _navigationService_NavigationFailed; this.NavigateTo(); }
public void SetupNavigationService(Frame frame) { if (_container.HasHandler(typeof(INavigationService), null)) { _container.UnregisterHandler(typeof(INavigationService), null); } _navigationService = _container.RegisterNavigationService(frame); if (_resume) { _navigationService.ResumeState(); } }
private void SetupNavigation(Frame frame) { _navigation = _container.RegisterNavigationService(frame); _navigation.BackRequested += (sender, args) => { if (_navigation.CanGoBack) { _navigation.GoBack(); } else { TryClose(); } }; }
public void SetupNavigationService(Frame frame, UIElement shellView) { _frame = frame; _shellView = shellView; if (_container.HasHandler(typeof(INavigationService), null)) { _container.UnregisterHandler(typeof(INavigationService), null); } _navigationService = _container.RegisterNavigationService(frame); #if ARM var dispatcher = CoreWindow.GetForCurrentThread().Dispatcher; InitializeTouch(dispatcher); #endif InitializeRfid(); }
public void SetupNavigationService(Frame frame) { _navigationService = _container.RegisterNavigationService(frame); if (_resume) { _navigationService.ResumeState(); } else { // _navigationService.For<MainPageViewModel>().Navigate(); // var vm = _navigationService.For<ReadoutViewModel>(); // vm.Navigate(); _navigationService.For <ReadoutViewModel>().Navigate(); } ; }
/// <summary> /// Setups the navigation. /// </summary> /// <param name="frame">The frame.</param> public void SetupNavigation(Frame frame) { _navigation = _container.RegisterNavigationService(frame); _navigation.BackRequested += (sender, args) => { args.Handled = true; if (_navigation.CanGoBack) { _navigation.GoBack(); } else { TryClose(); } }; _navigation.For <HomePageViewModel>().Navigate(); }
public void SetupNavigationService(object sender, RoutedEventArgs e) { _navigationService = _container.RegisterNavigationService((Frame)sender); NavigateToSplash(); }
protected override void PrepareViewFirst(Frame rootFrame) { _navigationService = container.RegisterNavigationService(rootFrame); SuspensionManager.RegisterFrame(rootFrame, "AppFrame"); }
public void PhoneFrame(Frame frame) { PhoneNavigationService = _container.RegisterNavigationService(frame); PhoneNavigationService.Navigated += (s, e) => UpdatePhoneBackButton(); }
public INavigationService CreateNavigationService(WinRTContainer container) { var navigationService = container.RegisterNavigationService(shellFrame); return(navigationService); }
protected override void PrepareViewFirst(Windows.UI.Xaml.Controls.Frame rootFrame) { container.RegisterNavigationService(rootFrame); }
public void SetupNavigationService(Frame frame) { navigationService = container.RegisterNavigationService(frame); navigationService.Navigated += OnNavigated; }
public INavigationService CreateNavigationService(WinRTContainer container) { return(container.RegisterNavigationService(shellFrame)); }
protected override void PrepareViewFirst(Frame rootFrame) { _container.RegisterNavigationService(rootFrame); }
protected override void PrepareViewFirst(Frame rootFrame) { // Use the new caching frame adapter rather than the normal one _container.RegisterNavigationService(rootFrame, cacheViewModels: true); }