public static async Task PushPopupPageAsync(this INavigationService navigationService, string name, NavigationParameters parameters = null, bool animated = true)
        {
            try
            {
                var page = CreatePopupPageByName(name);

                // Ensure resolved page is not null. This could happen if the resolved page wasn't a Popup Page
                if (page == null)
                {
                    throw new PopupPageMissingException($"It seems something went wrong. We seem to have resolved a page for '{name}', but it doesn't seem to be a Popup Page.", new ArgumentNullException(nameof(page)));
                }

                // Make sure the VML is set to either True or False
                if (ViewModelLocator.GetAutowireViewModel(page) == null)
                {
                    ViewModelLocator.SetAutowireViewModel(page, true);
                }

                var currentPage = GetCurrentPage();

                EnsureParametersContainsMode(parameters ?? (parameters = PopupUtilities.CreateNewNavigationParameters()), NavigationMode.New);

                HandleINavigatingAware(page, parameters);
                await s_popupNavigation.PushAsync(page, animated);

                HandleINavigatedAware(currentPage, page, parameters);
            }
            catch (Exception ex)
            {
                s_logger.Log(ex.ToString(), Logging.Category.Exception, Logging.Priority.High);
                throw;
            }
        }
        private static void HandleINavigatedAware(Page page, NavigationParameters parameters, bool navigatedTo)
        {
            if (page == null)
            {
                return;
            }
            if (parameters == null)
            {
                parameters = navigatedTo ?
                             PopupUtilities.CreateNewNavigationParameters() :
                             PopupUtilities.CreateBackNavigationParameters();
            }

            PageUtilities.InvokeViewAndViewModelAction <INavigatedAware>(page, (view) => {
                if (navigatedTo)
                {
                    view.OnNavigatedTo(parameters);
                }
                else
                {
                    view.OnNavigatedFrom(parameters);
                }
            });

            PageUtilities.InvokeViewAndViewModelAction <IActiveAware>(page, (view) => view.IsActive = navigatedTo);
        }