Exemplo n.º 1
0
 // 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;
 }
Exemplo n.º 2
0
 private void FacadeNavigatingCancelEventHandler(object sender, NavigatingCancelEventArgs e)
 {
     var args = new NavigatingEventArgs(e);
     foreach (var handler in _navigatingEventHandlers)
     {
         handler(this, args);
     }
     e.Cancel = args.Cancel;
 }