public async Task ActivateAsync(object activationArgs) { _backgroundTaskService.RegisterBackgroundTask("BingNewImageTrigger", new TimeTrigger(15, false), false); if (IsInteractive(activationArgs)) { await InitializeAsync(); if (Window.Current.Content == null) { Window.Current.Content = _shell?.Value ?? new Frame(); NavigationService.NavigationFailed += (sender, e) => { throw e.Exception; }; NavigationService.Navigated += Frame_Navigated; if (SystemNavigationManager.GetForCurrentView() != null) { SystemNavigationManager.GetForCurrentView().BackRequested += ActivationService_BackRequested; } } } var activationHandler = GetActivationHandlers() .FirstOrDefault(h => h.CanHandle(activationArgs)); if (activationHandler != null) { await activationHandler.HandleAsync(activationArgs); } if (IsInteractive(activationArgs)) { var defaultHandler = new DefaultLaunchActivationHandler(_defaultNavItem); if (defaultHandler.CanHandle(activationArgs)) { await defaultHandler.HandleAsync(activationArgs); } Window.Current.Activate(); await StartupAsync(); } }