Ejemplo n.º 1
0
        private async Task <bool> NavingFromAsync(Portable.INavigatingAwareAsync viewmodel, Page page, object currentParameter, bool suspending, NavigationMode navigationMode, Type targetPageType, object targetParameter)
        {
            var deferral            = new Template10.Mobile.Common.DeferralManager();
            var navigatingEventArgs = new Portable.NavigatingEventArgs(deferral)
            {
                Page                = page,
                Parameter           = currentParameter,
                Suspending          = suspending,
                NavigationMode      = navigationMode.ToTemplate10NavigationMode(),
                TargetPageType      = targetPageType,
                TargetPageParameter = targetParameter,
            };

            try
            {
                await viewmodel.OnNavigatingFromAsync(navigatingEventArgs);

                await deferral.WaitForDeferralsAsync();
            }
            catch
            {
                Debugger.Break();
            }
            return(navigatingEventArgs.Cancel);
        }
Ejemplo n.º 2
0
        public bool RaiseNavigatingCancels(object page, object parameter, bool suspending, Portable.NavigationMode mode, Type targetType)
        {
            var navigatingDeferral  = new Template10.Mobile.Common.DeferralManager();
            var navigatingEventArgs = new Portable.NavigatingEventArgs(navigatingDeferral)
            {
                Page                = page,
                Parameter           = parameter,
                Suspending          = suspending,
                NavigationMode      = mode,
                TargetPageType      = targetType,
                TargetPageParameter = parameter,
            };

            RaiseNavigating(navigatingEventArgs);
            return(navigatingEventArgs.Cancel);
        }
Ejemplo n.º 3
0
 internal void RaiseNavigating(Portable.NavigatingEventArgs e) => Navigating?.Invoke(this, e);
Ejemplo n.º 4
0
 public void RaiseNavigating(Portable.NavigatingEventArgs e)
 {
     Navigating?.Invoke(this, e);
     // for backwards compat
     FrameFacade.RaiseNavigating(e);
 }