bool NavigatingFrom(bool suspending)
 {
     var page = _frame.Content as FrameworkElement;
     if (page != null)
     {
         var dataContext = page.DataContext as INavigatable;
         if (dataContext != null)
         {
             var args = new NavigatingEventArgs
             {
                 PageType = _frame.CurrentPageType,
                 Parameter = _frame.CurrentPageParam,
                 Suspending = suspending,
             };
             dataContext.OnNavigatingFrom(args);
             return !args.Cancel;
         }
     }
     return true;
 }
Exemple #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;
 }