Exemplo n.º 1
0
        /// <summary>
        /// Return value indicates whether navigation should be cancelled
        /// </summary>
        internal bool CallOnLeavingNavigation(bool allowCancelNavigation)
        {
            var vm = GetCurrentViewModel();

            if (vm != null)
            {
                var ev = new LeavingPageEventArgs()
                {
                    CancellingNavigationAllowed = allowCancelNavigation
                };
                vm.OnLeave(ev);
                return(ev.CancelNavigation);
            }
            return(false);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Called when navigating away from ViewModel.
 /// It's possible to cancel navigation with "args.CancelNavigation = true"
 /// </summary>
 public virtual void OnLeave(LeavingPageEventArgs args)
 {
 }