當前位置: 首頁>>代碼示例>>C#>>正文


C# BackRequestedEventArgs類代碼示例

本文整理匯總了C#中BackRequestedEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# BackRequestedEventArgs類的具體用法?C# BackRequestedEventArgs怎麽用?C# BackRequestedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BackRequestedEventArgs類屬於命名空間,在下文中一共展示了BackRequestedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CustomConnectedAnimationDetail_BackRequested

        private void CustomConnectedAnimationDetail_BackRequested(object sender, BackRequestedEventArgs e)
        {
            if (!e.Handled)
            {
                // Unregister the handler
                SystemNavigationManager.GetForCurrentView().BackRequested -= CustomConnectedAnimationDetail_BackRequested;

                // We are about to transition to a new page.  Cancel any outstanding transitions.
                if (_currentTransition != null)
                {
                    if (!_currentTransition.Completed)
                    {
                        _currentTransition.Cancel();
                    }
                    _currentTransition = null;
                }

                // Setup the new transition and trigger the navigation
                ConnectedTransition transition = new ConnectedTransition();
                transition.Initialize(_host, ThumbnailImage, _detailsInfo);

                _host.Navigate(typeof(CustomConnectedAnimation), transition);

                // We've got it handled
                e.Handled = true;
            }
        }
開發者ID:chenjianwp,項目名稱:WindowsUIDevLabs,代碼行數:27,代碼來源:CustomConnectedAnimationDetail.cs

示例2: OnBackRequested

 private void OnBackRequested(object sender, BackRequestedEventArgs e) {
     // Mark event as handled so we don't get bounced out of the app.
     e.Handled = true;
     // Page above us will be our master view.
     // Make sure we are using the "drill out" animation in this transition.
     Frame.Navigate(typeof(SearchResult), "Back", new EntranceNavigationTransitionInfo());
 }
開發者ID:MobilePractice,項目名稱:drink-windows,代碼行數:7,代碼來源:ProductDetail.xaml.cs

示例3: MainPage_BackRequested

 private void MainPage_BackRequested(object sender, BackRequestedEventArgs e)
 {
     if (InnerFrame.CanGoBack)
     {
         InnerFrame.GoBack();
     }
 }
開發者ID:wpdu,項目名稱:ControlTest,代碼行數:7,代碼來源:MainPage.xaml.cs

示例4: AddGalery_BackRequested

 private void AddGalery_BackRequested(object sender, BackRequestedEventArgs e)
 {
     if (e.Handled == false) {
         e.Handled = true;
         rootFrame.GoBack();
     }
 }
開發者ID:milo2005,項目名稱:W10_Controles_avanzados,代碼行數:7,代碼來源:AddGalery.xaml.cs

示例5: MainPage_BackRequested

 /// <summary>
 /// 係統後退
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void MainPage_BackRequested(object sender, BackRequestedEventArgs e)
 {
     if (!sptViewNavigation.IsSwipeablePaneOpen)
     {
         if (this.frmPages.CanGoBack && !this.frmPages.Content.GetType().Equals(typeof(HomePage)))  //
         {
             this.frmPages.GoBack();
         }
         else
         {
             if (popTips.IsOpen)  //第二次按back鍵
             {
                 Application.Current.Exit();
             }
             else
             {
                 popTips.IsOpen = true;  //提示再按一次
                 popTips.HorizontalOffset = this.ActualWidth / 2 - 45;  //居中
                 popTips.VerticalOffset = this.ActualHeight / 2 - 5;
                 e.Handled = true;
                 await Task.Delay(1000);  //1000ms後關閉提示
                 popTips.IsOpen = false;
             }
         }
     }
     else
     {
         sptViewNavigation.IsSwipeablePaneOpen = false;
     }
     e.Handled = true;
 }
開發者ID:lhysrc,項目名稱:ZhiHuDaily.UWP,代碼行數:36,代碼來源:MainPage.xaml.cs

示例6: OnBackRequested

 // What happens when back button is pressed
 private void OnBackRequested(object sender, BackRequestedEventArgs backRequestedEventArgs)
 {
     if (Frame.CanGoBack)
         Frame.GoBack();
     // mark the event as handled so that UI will not handle
     backRequestedEventArgs.Handled = true;
 }
開發者ID:yigityesilpinar,項目名稱:Polish-Namedays-Windows-Store-Application,代碼行數:8,代碼來源:AboutPage.xaml.cs

示例7: OnBackRequested

        private void OnBackRequested(object sender, BackRequestedEventArgs backRequestedEventArgs)
        {
            if (Frame.CanGoBack)
                Frame.GoBack();

            backRequestedEventArgs.Handled = true;
        }
開發者ID:codinesh,項目名稱:LearningUWP,代碼行數:7,代碼來源:AboutPage.xaml.cs

示例8: Go_Back

        private void Go_Back(object sender, BackRequestedEventArgs e)
        {
            systemNavigationManager.BackRequested -= Go_Back;

            if (!isNarrow || (isNarrow && !isEditting)) {
                System.Diagnostics.Debug.WriteLine("Going back to Main");

                Frame rootFrame = Window.Current.Content as Frame;
                if (rootFrame == null)
                    return;

                // Navigate back if possible, and if the event has not 
                // already been handled .
                if (rootFrame.CanGoBack && e.Handled == false)
                {
                    e.Handled = true;
                    rootFrame.GoBack();
                }
            }
            else {
                System.Diagnostics.Debug.WriteLine("Going back to Master");

                e.Handled = true;
                isEditting = false;
                adjustColumns();
                systemNavigationManager.BackRequested += Go_Back;

            }

        }
開發者ID:lamarios,項目名稱:Pydio-UWP,代碼行數:30,代碼來源:Settings.xaml.cs

示例9: OnBackRequested

 private void OnBackRequested(object sender, BackRequestedEventArgs e)
 {
     if ( lastpage == typeof(MainPage))
         this.Frame.Navigate(typeof(MainPage));
     else if (lastpage == typeof(Pages.Page_Livros))
         this.Frame.Navigate(typeof(Pages.Page_Livros));
 }
開發者ID:MarianaDias,項目名稱:ProjetoAthena,代碼行數:7,代碼來源:Page_Sobre.xaml.cs

示例10: SystemNavigationManager_BackRequested

 private void SystemNavigationManager_BackRequested(object sender, BackRequestedEventArgs e)
 {
     if (!e.Handled)
     {
         e.Handled = TryGoBack();
     }
 }
開發者ID:Azure-Samples,項目名稱:MyDriving,代碼行數:7,代碼來源:PastTripsMenuView.xaml.cs

示例11: backButton

 private void backButton(object sender, BackRequestedEventArgs e)
 {  
     if (Frame.CanGoBack) {
         e.Handled = true;
         Frame.GoBack();
     }  
 }
開發者ID:InZernetTechnologies,項目名稱:PicLoc-Windows,代碼行數:7,代碼來源:send_snap.xaml.cs

示例12: App_BackRequested

        private void App_BackRequested(object sender, BackRequestedEventArgs e)
        {
            if (!e.Handled)
            {
                if (CommunityItemPhotoGrid.Visibility == Visibility.Visible)
                {
                    CommunityItemPhotoGrid.Visibility = Visibility.Collapsed;
                    //SystemNavigationManager.GetForCurrentView().BackRequested -= App_BackRequested;
                    //SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
                }
                else if (ContentFrame.Visibility == Visibility.Visible)
                {
                    if (!App.isPerInfoContentImgShow)
                    {   //SystemNavigationManager.GetForCurrentView().BackRequested -= App_BackRequested;
                        //SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
                        ContentFrame.Visibility = Visibility.Collapsed;
                        //CommunityMyAppBarButton.Visibility = Visibility.Visible;
                    }
                }
                else
                {

                    if (Frame.CanGoBack)
                    {
                        Frame.GoBack();
                    }
                    SystemNavigationManager.GetForCurrentView().BackRequested -= App_BackRequested;
                    SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
                }
            }
            e.Handled = true;
        }
開發者ID:RedrockMobile,項目名稱:CyxbsMobile_Win,代碼行數:32,代碼來源:CommunityPersonInfo.xaml.cs

示例13: OnBackRequested

        public void OnBackRequested(object sender, BackRequestedEventArgs e)
        {
            Debug.WriteLine("On Back request");
            var navigableViewModel = this.DataContext as INavigable;
            if (navigableViewModel != null)
            {
                if (navigableViewModel.AllowGoBack())
                {
                    if (this.Frame.CanGoBack)
                    {
                        this.Frame.GoBack();
                        //Prevent out app
                        if (e != null)
                            e.Handled = true;
                    }
                }
                else
                {
                    if (e != null)
                        //Prevent out app
                        e.Handled = true;
                }

            }
            else
            {
                if (App.Current.NavigationService.CanGoBack())
                {
                    App.Current.NavigationService.GoBack();
                    //Prevent out app
                    if (e != null)
                        e.Handled = true;
                }
            }
        }
開發者ID:sutoentertainment,項目名稱:BaoViet,代碼行數:35,代碼來源:BindablePage.cs

示例14: SystemNavigationManager_BackRequested

 private void SystemNavigationManager_BackRequested(object sender, BackRequestedEventArgs e)
 {
     profileViewModel.PropertyChanged += ViewModel_PropertyChanged;
     if (!e.Handled)
     {
         e.Handled = TryGoBack();
     }
 }
開發者ID:Azure-Samples,項目名稱:MyDriving,代碼行數:8,代碼來源:ProfileView.xaml.cs

示例15: CurrentView_BackRequested

 private void CurrentView_BackRequested(object sender, BackRequestedEventArgs e)
 {
     if (this.Frame.CanGoBack)
     {
         e.Handled = true;
         this.Frame.GoBack();
     }
 }
開發者ID:k-net-community,項目名稱:Win10ForDev,代碼行數:8,代碼來源:Page2.xaml.cs


注:本文中的BackRequestedEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。