Пример #1
0
        public void Initialize(Frame frame, WinUI.NavigationView navigationView, IList <KeyboardAccelerator> keyboardAccelerators)
        {
//^^
//{[{
            IdentityService.LoggedOut       += OnLoggedOut;
            UserDataService.UserDataUpdated += OnUserDataUpdated;
//}]}
        }
Пример #2
0
        public void Initialize(Frame frame, WinUI.NavigationView navigationView, IList <KeyboardAccelerator> keyboardAccelerators)
        {
//^^
//{[{
            NavigationService.OnCurrentPageCanGoBackChanged += OnCurrentPageCanGoBackChanged;
//}]}
            _navigationView.BackRequested += OnBackRequested;
        }
        public void Initialize(Frame frame, WinUI.NavigationView navigationView)
        {
//^^
//{[{
            _backNavigationService.Initialize(frame);
            _backNavigationService.OnCurrentPageCanGoBackChanged += OnCurrentPageCanGoBackChanged;
//}]}
            _navigationView.BackRequested += OnBackRequested;
        }
Пример #4
0
 public void Initialize(Frame frame, WinUI.NavigationView navigationView)
 {
     _navigationView         = navigationView;
     frame.NavigationFailed += (sender, e) =>
     {
         throw e.Exception;
     };
     frame.Navigated += Frame_Navigated;
     _navigationView.BackRequested += OnBackRequested;
 }
Пример #5
0
        private void OnItemInvoked(WinUI.NavigationView sender, WinUI.NavigationViewItemInvokedEventArgs args)
        {
            //{[{
            if (args.IsSettingsInvoked)
            {
                NavigationService.Navigate(typeof(wts.ItemNamePage));
                return;
            }

            //}]}
        }
Пример #6
0
        private void OnItemInvoked(WinUI.NavigationView sender, WinUI.NavigationViewItemInvokedEventArgs args)
        {
            if (args.IsSettingsInvoked)
            {
//{--{
                // Navigate to the settings page - implement as appropriate if needed
//}--}
                //{[{
                NavigationService.Navigate(typeof(wts.ItemNamePage), null, args.RecommendedNavigationTransitionInfo);
                //}]}
            }
        }
        private void OnBackRequested(WinUI.NavigationView sender, WinUI.NavigationViewBackRequestedEventArgs args)
        {
//{[{
            if (_currentPageCanGoBack)
            {
                if (_frame.Content is FrameworkElement element && element.DataContext is IBackNavigationHandler navigationHandler)
                {
                    navigationHandler.GoBack();
                    return;
                }
            }

//}]}
            _navigationService.GoBack();
        }
Пример #8
0
 private void OnBackRequested(WinUI.NavigationView sender, WinUI.NavigationViewBackRequestedEventArgs args)
 {
     _navigationService.GoBack();
 }