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


C# NavigationService.NavigatingEventArgs類代碼示例

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


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

示例1: OnNavigatingFromAsync

 public Task OnNavigatingFromAsync(NavigatingEventArgs args)
 {
     if (galleryMetaInfo == null)
         BootStrapper.Current.SessionState["GalleryInfo"] = new GalleryMetaInfo { Gallery = Images, SelectedIndex = FlipViewIndex };
     else
         galleryMetaInfo.SelectedIndex = FlipViewIndex;
     return Task.CompletedTask;
 }
開發者ID:akshay2000,項目名稱:MonocleGiraffe,代碼行數:8,代碼來源:BrowserPageViewModel.cs

示例2: OnNavigatingFrom

 public override void OnNavigatingFrom(NavigatingEventArgs args)
 {
     try
     {
         ApplicationView view = ApplicationView.GetForCurrentView();
         view.ExitFullScreenMode();
     }
     catch (Exception)
     {
     }
 }
開發者ID:KhaledJemni,項目名稱:UWP-App-Samples,代碼行數:11,代碼來源:HelpPageViewModel.cs

示例3: NavigatingFrom

 // before navigate (cancellable)
 bool NavigatingFrom(bool suspending)
 {
     var page = FrameFacade.Content as Page;
     if (page != null)
     {
         var dataContext = page.DataContext as INavigable;
         if (dataContext != null)
         {
             var args = new NavigatingEventArgs
             {
                 PageType = FrameFacade.CurrentPageType,
                 Parameter = FrameFacade.CurrentPageParam,
                 Suspending = suspending,
             };
             dataContext.OnNavigatingFrom(args);
             return !args.Cancel;
         }
     }
     return true;
 }
開發者ID:qmatteoq,項目名稱:Template10,代碼行數:21,代碼來源:NavigationService.cs

示例4: FacadeNavigatingCancelEventHandler

        private void FacadeNavigatingCancelEventHandler(object sender, NavigatingCancelEventArgs e)
        {
            DebugWrite();

            object parameter = null;
            try
            {
                parameter = SerializationService.Deserialize(e.Parameter?.ToString());
            }
            catch (Exception ex)
            {
                throw new Exception("Your parameter must be serializable. If it isn't, then use SessionState.", ex);
            }
            var args = new NavigatingEventArgs(e, Content as Page, parameter);
            if (NavigationModeHint != NavigationMode.New)
                args.NavigationMode = NavigationModeHint;
            NavigationModeHint = NavigationMode.New;
            foreach (var handler in _navigatingEventHandlers)
            {
                handler(this, args);
            }
            e.Cancel = args.Cancel;
        }
開發者ID:DanTheManSWE,項目名稱:Template10,代碼行數:23,代碼來源:FrameFacade.cs

示例5: FacadeNavigatingCancelEventHandler

        private void FacadeNavigatingCancelEventHandler(object sender, NavigatingCancelEventArgs e)
        {
            DebugWrite();

            var parameter = SerializationService.Deserialize(e.Parameter?.ToString());
            var args = new NavigatingEventArgs(e, Content as Page, parameter);
            if (NavigationModeHint != NavigationMode.New)
                args.NavigationMode = NavigationModeHint;
            NavigationModeHint = NavigationMode.New;
            foreach (var handler in _navigatingEventHandlers)
            {
                handler(this, args);
            }
            e.Cancel = args.Cancel;
        }
開發者ID:crazycreak,項目名稱:Template10,代碼行數:15,代碼來源:FrameFacade.cs

示例6: OnNavigatingFromAsync

        public override async Task OnNavigatingFromAsync(NavigatingEventArgs args)
        {
          

            await base.OnNavigatingFromAsync(args);
        }
開發者ID:RareNCool,項目名稱:Renttracker,代碼行數:6,代碼來源:MapPageViewModel.cs

示例7: OnNavigatingFrom

 public override void OnNavigatingFrom(NavigatingEventArgs args)
 {
     args.Cancel = false;
 }
開發者ID:DarthPedro,項目名稱:Template10,代碼行數:4,代碼來源:DetailPageViewModel.cs

示例8: OnNavigatingFromAsync

 public override Task OnNavigatingFromAsync(NavigatingEventArgs args)
 {
     args.Cancel = false;
     return Task.CompletedTask;
 }
開發者ID:crazycreak,項目名稱:Template10,代碼行數:5,代碼來源:DetailPageViewModel.cs

示例9: OnNavigatingFromAsync

 public override async Task OnNavigatingFromAsync(NavigatingEventArgs args)
 {
     args.Cancel = false;
     await Task.CompletedTask;
 }
開發者ID:C9Kamis,項目名稱:PoGo-UWP,代碼行數:5,代碼來源:GameMapPageViewModel.cs

示例10: OnNavigatingFromAsync

 public override Task OnNavigatingFromAsync(NavigatingEventArgs args)
 {
     return base.OnNavigatingFromAsync(args);
 }
開發者ID:Bernie-2016,項目名稱:Connect-Windows,代碼行數:4,代碼來源:ActionsViewModel.cs

示例11: FacadeNavigatingCancelEventHandler

 private void FacadeNavigatingCancelEventHandler(object sender, NavigatingCancelEventArgs e)
 {
     var args = new NavigatingEventArgs(e, Content as Page);
     if (NavigationModeHint != NavigationMode.New)
         args.NavigationMode = NavigationModeHint;
     NavigationModeHint = NavigationMode.New;
     foreach (var handler in _navigatingEventHandlers)
     {
         handler(this, args);
     }
     e.Cancel = args.Cancel;
 }
開發者ID:DarthPedro,項目名稱:Template10,代碼行數:12,代碼來源:FrameFacade.cs

示例12: OnNavigatingFrom

 public override async void OnNavigatingFrom(NavigatingEventArgs args)
 {
     await ExecuteSaveCommand();
 }
開發者ID:Himansh1306,項目名稱:Template10,代碼行數:4,代碼來源:MainPageViewModel.cs

示例13: OnNavigatingFromAsync

 public override Task OnNavigatingFromAsync(NavigatingEventArgs args)
 {
     _dispatcherTimer.Stop();
     return Task.CompletedTask;
 }
開發者ID:gk-8,項目名稱:Beacon-Insights,代碼行數:5,代碼來源:RadarPageViewModel.cs

示例14: NavingFromCancelsAsync

        public async Task<bool> NavingFromCancelsAsync(object viewmodel, NavigationMode mode, Page sourcePage, Type sourceType, object sourceParameter, Page targetPage, Type targetType, object targetParameter, bool suspending)
        {
            Services.NavigationService.NavigationService.DebugWrite();

            if (sourcePage == null)
            {
                return false;
            }
            else if (viewmodel == null)
            {
                return false;
            }
            else if (viewmodel is Classic.INavigatingAwareAsync)
            {
                var deferral = new DeferralManager();
                var navigatingEventArgs = new Classic.NavigatingEventArgs(deferral)
                {
                    Page = sourcePage,
                    PageType = sourcePage?.GetType(),
                    Parameter = sourceParameter,
                    NavigationMode = mode,
                    TargetPageType = targetType,
                    TargetPageParameter = targetParameter,
                    Suspending = suspending,
                };
                try
                {
                    var vm = viewmodel as Classic.INavigatingAwareAsync;
                    await vm?.OnNavigatingFromAsync(navigatingEventArgs);
                    await deferral.WaitForDeferralsAsync();
                }
                catch
                {
                    Debugger.Break();
                }
                return navigatingEventArgs.Cancel;
            }
            else if (viewmodel is Portable.IConfirmNavigationAsync)
            {
                var parameters = new Portable.NavigationParameters();
                parameters.Add("NavigationMode", mode.ToPrismNavigationMode());
                parameters.Add("SourceType", sourceType);
                parameters.Add("SourceParameter", sourceParameter);
                parameters.Add("TargetType", targetType);
                parameters.Add("TargetParameter", targetParameter);
                parameters.Add("Suspending", suspending);
                var vm = viewmodel as Portable.IConfirmNavigationAsync;
                return !await vm?.CanNavigateAsync(parameters);
            }
            else
            {
                return true;
            }
        }
開發者ID:GFlisch,項目名稱:Template10,代碼行數:54,代碼來源:NavigationLogic.cs

示例15: OnNavigatingFromAsync

 public override Task OnNavigatingFromAsync(NavigatingEventArgs args)
 {
     _beaconManagementService.StopAdvertising();
     return base.OnNavigatingFromAsync(args);
 }
開發者ID:gk-8,項目名稱:Beacon-Insights,代碼行數:5,代碼來源:AdvertisingPageViewModel.cs


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