当前位置: 首页>>代码示例>>C#>>正文


C# NavigationService.GoBack方法代码示例

本文整理汇总了C#中System.Windows.Navigation.NavigationService.GoBack方法的典型用法代码示例。如果您正苦于以下问题:C# NavigationService.GoBack方法的具体用法?C# NavigationService.GoBack怎么用?C# NavigationService.GoBack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Navigation.NavigationService的用法示例。


在下文中一共展示了NavigationService.GoBack方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TryGoBack

 public static void TryGoBack(NavigationService NavigationService, Uri DefaultLocation)
 {
     if (NavigationService.CanGoBack)
         NavigationService.GoBack();
     else
         NavigationService.Navigate(DefaultLocation);
 }
开发者ID:ireynolds,项目名称:Document-Store,代码行数:7,代码来源:Utils.cs

示例2: NavigateToBrowserPatient

 /// <summary>
 /// réponse à la commande click
 /// </summary>
 private void NavigateToBrowserPatient()
 {
     _ns = NavigationService.GetNavigationService(_linkedView);
     _ns.GoBack();
 }
开发者ID:chahla,项目名称:wpf-medical,代码行数:8,代码来源:PatientPictureViewModel.cs

示例3: ActivateNavigationService

        public void ActivateNavigationService(NavigationService navigationService, bool deactivateAfterNavigation)
        {
            Action<PageSwitchedAggregatedEvent> callback = null;

            callback = ae =>
                           {
                               try
                               {
                                   this._logService.Trace(string.Format("About to navigate to: {0}. Use navigate service operation : {1}", ae.NavigationServiceOperation, ae.UseNavigationServiceOperation));

                                   this._logService.Trace(string.Format("navigationService: {0}.", navigationService));

                                   if (!ae.UseNavigationServiceOperation)
                                   {
                                       navigationService.Navigate(ae.Uri);
                                   }
                                   else
                                   {
                                       switch (ae.NavigationServiceOperation)
                                       {
                                           case PageSwitchedAggregatedEvent.NavigationServiceOperations.GoBack:
                                               navigationService.GoBack();
                                               break;
                                           case PageSwitchedAggregatedEvent.NavigationServiceOperations.GoForward:
                                               navigationService.GoForward();
                                               break;
                                           case PageSwitchedAggregatedEvent.NavigationServiceOperations.StopLoading:
                                               navigationService.StopLoading();
                                               break;
                                           default:
                                               throw new ArgumentOutOfRangeException();
                                       }
                                   }
                                   this._logService.Trace(string.Format("Call to navigationServie issued. Deactivate after navigation : {0}", deactivateAfterNavigation));

                                   if (deactivateAfterNavigation)
                                   {
                                       // callback will not be modified, therefore : no need to make a copy to avoid accessing a modified closure.
                                       _eventAggregator.GetEvent<CompositePresentationEvent<PageSwitchedAggregatedEvent>>().Unsubscribe(callback);
                                   }
                               }
                               catch (InvalidOperationException e)
                               {
                                    _notificationService.Warning("Open syno is already navigating to a page. Please wait until the current navigation is over before switching to an other page.", "Just a second...");
                               }

                           };

            _eventAggregator.GetEvent<CompositePresentationEvent<PageSwitchedAggregatedEvent>>().Subscribe(callback, true);
        }
开发者ID:salfab,项目名称:open-syno,代码行数:50,代码来源:SearchView.xaml.cs

示例4: NavigateToHome

 /// <summary>
 /// réponse à la commande click
 /// </summary>
 private void NavigateToHome()
 {
     _ns = NavigationService.GetNavigationService(_linkedView);
     _ns.GoBack();
 }
开发者ID:chahla,项目名称:wpf-medical,代码行数:8,代码来源:MemberBrowserViewModel.cs


注:本文中的System.Windows.Navigation.NavigationService.GoBack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。