Example #1
0
        /// <summary>
        ///  A task for asynchronously pushing a view onto the navigation stack, with optional animation.
        /// </summary>
        /// <param name="viewType">The type of the view</param>
        /// <param name="parameter">The paramter to pass to the view model</param>
        /// <param name="animated">Animate the transition</param>
        /// <returns>The asynchrous task representing the transition</returns>
        public Task NavigateToViewAsync(Type viewType, object parameter = null, bool animated = true)
        {
            if (!CanClose())
            {
                return(Task.FromResult(false));
            }

            var view = ViewLocator.GetOrCreateViewType(viewType);

            return(PushAsync(view, parameter, animated));
        }
        /// <summary>
        ///  A task for asynchronously pushing a view onto the navigation stack, with optional animation.
        /// </summary>
        /// <param name="viewType">The type of the view</param>
        /// <param name="parameter">The paramter to pass to the view model</param>
        /// <param name="animated">Animate the transition</param>
        /// <returns>The asynchrous task representing the transition</returns>
        public async Task NavigateToViewAsync(Type viewType, object parameter = null, bool animated = true)
        {
            var canClose = await CanCloseAsync();

            if (!canClose)
            {
                return;
            }

            var view = ViewLocator.GetOrCreateViewType(viewType);

            await PushAsync(view, parameter, animated);
        }