private void Renavigate([NotNull] INavigationContext context, NavigatingCancelEventArgsBase args)
 {
     if (_navigatingCancelArgs == null)
     {
         if (!NavigationService.Navigate(args))
         {
             TryCompleteNavigationTask(args.Context, false);
             NavigationDispatcher.OnNavigationCanceled(context);
         }
     }
     else
     {
         _navigatingCancelArgs.Cancel = false;
     }
 }
        protected virtual void OnNavigating(NavigatingCancelEventArgsBase args)
        {
            if (args.Context.Contains(IgnoreNavigatingConstant))
            {
                return;
            }
            var context = CreateContextNavigateFrom(args);

            if (context == null)
            {
                return;
            }

            args.Cancel = true;
            var navigateTask = !args.IsCancelable
                ? Empty.TrueTask
                : NavigationDispatcher.OnNavigatingAsync(context);

            navigateTask.TryExecuteSynchronously(task =>
            {
                if (!task.IsCanceled && task.IsFaulted)
                {
                    TryCompleteNavigationTask(args.Context, false);
                    NavigationDispatcher.OnNavigationFailed(context, task.Exception);
                    return;
                }

                if (task.IsCanceled || !task.Result)
                {
                    TryCompleteNavigationTask(args.Context, false);
                    if (!context.NavigationMode.IsClose())
                    {
                        NavigationDispatcher.OnNavigationCanceled(context);
                    }
                    return;
                }
                ThreadManager.Invoke(ExecutionMode.AsynchronousOnUiThread, this, context, args, (@this, ctx, e) =>
                {
                    e.Context.AddOrUpdate(IgnoreNavigatingConstant, null);
                    @this.Renavigate(ctx, e);
                });
            });
        }