public INavigationService CreateNavigationService(WinRTContainer container)
        {
            var navigationService = container.RegisterNavigationService(shellFrame);

            navigationViewHeaderBehavior.Initialize(navigationService);
            return(navigationService);
        }
Example #2
0
        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;
            }
        }
Example #3
0
        public async void SetupNavigationService(object sender, RoutedEventArgs e)
        {
            _navigationService = _container.RegisterNavigationService((Frame)sender);
            await LoadResources();

            NavigateToMainView();
        }
Example #4
0
        public void RegisterFrame(Frame frame)
        {
            MarkedUp.AnalyticClient.RegisterNavigationFrame(frame);

            container.RegisterNavigationService(frame);

            navigationService = container.GetInstance <INavigationService>();
        }
Example #5
0
        public void SetupNavigationService(Frame frame)
        {
            _navigationService = _container.RegisterNavigationService(frame);

            if (_resume)
            {
                _navigationService.ResumeState();
            }
        }
Example #6
0
        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();
            }
        }
Example #7
0
        public void RegisterFrame(Frame frame)
        {
            container.RegisterNavigationService(frame);

            navigationService = container.GetInstance <INavigationService>();

            navigationService.Navigated += (s, e) => NotifyOfPropertyChange(nameof(CanGoBack));

            navigationService.NavigateToViewModel <MenuViewModel>();
        }
Example #8
0
        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();
            }
        }
Example #9
0
        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);
        }
Example #10
0
        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();
            }
        }
Example #12
0
        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();
        }
Example #16
0
        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();
            }
            ;
        }
Example #17
0
        /// <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();
        }
Example #18
0
 public void SetupNavigationService(object sender, RoutedEventArgs e)
 {
     _navigationService = _container.RegisterNavigationService((Frame)sender);
     NavigateToSplash();
 }
Example #19
0
 protected override void PrepareViewFirst(Frame rootFrame)
 {
     _navigationService = container.RegisterNavigationService(rootFrame);
     SuspensionManager.RegisterFrame(rootFrame, "AppFrame");
 }
Example #20
0
 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);
        }
Example #22
0
 protected override void PrepareViewFirst(Windows.UI.Xaml.Controls.Frame rootFrame)
 {
     container.RegisterNavigationService(rootFrame);
 }
Example #23
0
 public void SetupNavigationService(Frame frame)
 {
     navigationService            = container.RegisterNavigationService(frame);
     navigationService.Navigated += OnNavigated;
 }
Example #24
0
 public INavigationService CreateNavigationService(WinRTContainer container)
 {
     return(container.RegisterNavigationService(shellFrame));
 }
Example #25
0
 protected override void PrepareViewFirst(Frame rootFrame)
 {
     _container.RegisterNavigationService(rootFrame);
 }
Example #26
0
 protected override void PrepareViewFirst(Frame rootFrame)
 {
     // Use the new caching frame adapter rather than the normal one
     _container.RegisterNavigationService(rootFrame, cacheViewModels: true);
 }