Esempio 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);
        }
Esempio 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)
 {
 }