public override async Task OnInitializeAsync(IActivatedEventArgs args) { if (Window.Current.Content as ModalDialog == null) { // create a new frame var nav = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include); // create modal root setting.GetThemeApp(); Window.Current.Content = new ModalDialog { DisableBackButtonWhenModal = true, Content = new Views.Shell(nav), }; } await Task.CompletedTask; }