private async void SecondaryAppView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { Debug.WriteLine($"SecondaryAppView_Consolidated: IsAppInitiated:{args.IsAppInitiated} IsUserInitiated:{args.IsUserInitiated}"); await PlaylistPlayer.ClearAsync(); await SecondaryViewPlayerNavigationService.NavigateAsync(nameof(BlankPage), _BlankPageNavgationTransitionInfo); // Note: 1803時点での話 // VisibleBoundsChanged がアプリ終了前に呼ばれるが // この際メインウィンドウとセカンダリウィンドウのウィンドウサイズが互い違いに送られてくるため // 直前のウィンドウサイズの値を前々回表示のウィンドウサイズ(_PrevSecondaryViewSize)で上書きする if (_PrevSecondaryViewSize != default(Size)) { var localObjectStorageHelper = Microsoft.Toolkit.Mvvm.DependencyInjection.Ioc.Default.GetService <Microsoft.Toolkit.Uwp.Helpers.LocalObjectStorageHelper>(); localObjectStorageHelper.Save(secondary_view_size, _PrevSecondaryViewSize); } _scheduler.Schedule(() => { IsShowSecondaryView = false; }); LastNavigatedPageName = null; // プレイヤーを閉じた時に再生中情報をクリア if (!isMainViewClosed) { Debug.WriteLine("ClearCurrentPlayerEntry secondary view closed."); _restoreNavigationManager.ClearCurrentPlayerEntry(); } }
private void AppView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { appViewConsolidated = true; windowClosed = true; TryCloseWindow(); Dispose(); }
private void ViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { ApplicationView.GetForCurrentView().Consolidated -= ViewConsolidated; mediaPlayer.MediaPlayer.Dispose(); mediaPlayer = null; Window.Current.Close(); }
void DemoView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { if (!CoreApplication.GetCurrentView().IsMain) { CloseDemoView(); } }
private void LyricView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { ApplicationView.GetForCurrentView().Consolidated -= LyricView_Consolidated; PlaybackEngine.PlaybackEngine.Current.PositionUpdated -= LyricView_PositionUpdated; PlaybackEngine.PlaybackEngine.Current.ItemsChanged -= LyricView_StatusChanged; MainPage.Current.LyricViewID = -1; }
private void View_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { if (Consolidated != null) { Consolidated(this, EventArgs.Empty); } }
static void Helper_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { sender.Consolidated -= Helper_Consolidated; if (!CoreApplication.GetCurrentView().IsMain) { Window.Current.Close(); } }
private void MainPage_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { Debug.WriteLine($"{ApplicationView.GetForCurrentView().Id} was consolidated"); if (!CoreApplication.GetCurrentView().IsMain) { CoreApplication.GetCurrentView().CoreWindow.Close(); } }
private void OnConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { if (RootElement is Frame frame) { frame.Content = null; } Handled = false; }
private async void PreviewWindow_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { System.Diagnostics.Debug.WriteLine($"Consolidated: user initiated: {args.IsUserInitiated}"); await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, delegate { OpenPaneButton.IsChecked = false; }); }
private void OnConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs e) { TraceLogger.GetInstance().DecreaseWindowCount(); if (m_parent.IsAlive) { var parent = m_parent.Target as App; parent.RemoveWindow(this); } }
private void View_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { var windowID = ApplicationView.GetApplicationViewIdForWindow(CoreWindow.GetForCurrentThread()); PlatformBase.CurrentCore.Logger.Log(LogLevels.Debug, $"Closed secondary window with ID {windowID}"); AppWindows.Remove(windowID); ApplicationView.GetForCurrentView().Consolidated -= View_Consolidated; Window.Current.Close(); }
private void OnViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { ViewModel = null; Bindings.StopTracking(); frame.Navigate(typeof(Page)); var appView = ApplicationView.GetForCurrentView(); appView.Consolidated -= OnViewConsolidated; ServiceLocator.DisposeCurrent(); }
private async void PropsView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { propsView.Consolidated -= PropsView_Consolidated; propsView = null; if (SecurityProperties != null) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => SecurityProperties.GetFilePermissions()); // Reload permissions } }
private void Properties_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { AppSettings.ThemeModeChanged -= AppSettings_ThemeModeChanged; ApplicationView.GetForCurrentView().Consolidated -= Properties_Consolidated; if (tokenSource != null && !tokenSource.IsCancellationRequested) { tokenSource.Cancel(); tokenSource = null; } }
private void LyricsView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { if (LyricsView == null) { return; } LyricsView.Consolidated -= LyricsView_Consolidated; LyricsView = null; }
private void OnViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { ViewModel.Unsubscribe(); ViewModel = null; Bindings.StopTracking(); var appView = ApplicationView.GetForCurrentView(); appView.Consolidated -= OnViewConsolidated; ServiceLocator.DisposeCurrent(); }
private async void MainPage_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { System.Diagnostics.Debug.WriteLine("Main page consolidated: " + args.IsUserInitiated); if (args.IsUserInitiated) { // you could so saving here await HidePreviewWindowAsync(true); } }
private void ApplicationView_OnConsolidated(ApplicationView s, ApplicationViewConsolidatedEventArgs e) { if (e.IsAppInitiated || e.IsUserInitiated) { s.Consolidated -= ApplicationView_OnConsolidated; DataContext = null; // this is only required if you are using compiled bindings (x:Bind) Bindings.StopTracking(); } }
private async void CurrentView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { // Clean up code to shut down the SqlBridge app as this one closes if ((App.Current as App).DatabaseServiceConnection != null) { // Signal app service console app to close itself ValueSet valueSet = new ValueSet(); valueSet.Add("request", "Exit"); var ignored = await(App.Current as App).DatabaseServiceConnection.SendMessageAsync(valueSet); } Application.Current.Exit(); }
private async void CurrentView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { // Since this main window is closing, close down the whole app if ((App.Current as App).DatabaseServiceConnection != null) { // Signal app service console app to close itself ValueSet valueSet = new ValueSet(); valueSet.Add("request", "Exit"); var ignored = await(App.Current as App).DatabaseServiceConnection.SendMessageAsync(valueSet); } Application.Current.Exit(); }
private void View_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { if (sender.Id == MainViewId) { var localObjectStorageHelper = Container.Resolve <Microsoft.Toolkit.Uwp.Helpers.LocalObjectStorageHelper>(); if (_PrevWindowSize != default(Size)) { localObjectStorageHelper.Save(HohoemaViewManager.primary_view_size, _PrevWindowSize); } MainViewId = -1; } }
private void Properties_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { AppSettings.ThemeModeChanged -= AppSettings_ThemeModeChanged; AppSettings.PropertyChanged -= AppSettings_PropertyChanged; // TODO: Replace this when windowing support is added //ApplicationView.GetForCurrentView().Consolidated -= Properties_Consolidated; //if (tokenSource != null && !tokenSource.IsCancellationRequested) //{ // tokenSource.Cancel(); // tokenSource.Dispose(); // tokenSource = null; //} }
/// <summary> /// 窗口已关闭 /// </summary> private void NewAppView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { viewClosed = true; if (!CacheView) { //选择不缓存的页面退出后导航到一个空白页 frame.Navigate(typeof(Page)); //清理Frame历史记录 frame.BackStack.Clear(); frame.ForwardStack.Clear(); } GC.Collect(); }
private async void LogViewPage_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { ApplicationView.GetForCurrentView().Consolidated -= LogViewPage_Consolidated; await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { _logView = null; _logViewFrame = null; ViewModel.DataReceived -= ViewModel_DataReceived; ViewLogButton.IsChecked = false; }); }
private void MainWindowView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { if (PlayerWindow == null) { App.Current.Exit(); } if (sender.Id == PlayerWindow.ViewId) { PlayerWindow.Closed(); } else { App.Current.Exit(); } }
private void ApplicationView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { if (_callLifetime != null) { _callLifetime.StopViewInUse(); _callLifetime.WindowWrapper.Window.Close(); _callLifetime = null; } if (_callPage != null) { _callPage.Dispose(); _callPage = null; } Aggregator.Publish(new UpdateCallDialog(_call, false)); }
private async void SecondaryAppView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { await SecondaryViewPlayerNavigationService.NavigateAsync(nameof(Views.BlankPage), new SuppressNavigationTransitionInfo()); // Note: 1803時点での話 // VisibleBoundsChanged がアプリ終了前に呼ばれるが // この際メインウィンドウとセカンダリウィンドウのウィンドウサイズが互い違いに送られてくるため // 直前のウィンドウサイズの値を前々回表示のウィンドウサイズ(_PrevSecondaryViewSize)で上書きする if (_PrevSecondaryViewSize != default(Size)) { var localObjectStorageHelper = App.Current.Container.Resolve <Microsoft.Toolkit.Uwp.Helpers.LocalObjectStorageHelper>(); localObjectStorageHelper.Save(secondary_view_size, _PrevSecondaryViewSize); } _scheduler.Schedule(() => { IsShowSecondaryView = false; }); }
private async void SecondaryAppView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { SecondaryViewPlayerNavigationService.Navigate(nameof(Views.BlankPage), null); // Note: 1803時点での話 // VisibleBoundsChanged がアプリ終了前に呼ばれるが // この際メインウィンドウとセカンダリウィンドウのウィンドウサイズが互い違いに送られてくるため // 直前のウィンドウサイズの値を前々回表示のウィンドウサイズ(_PrevSecondaryViewSize)で上書きする if (_PrevSecondaryViewSize != default(Size)) { var localObjectStorageHelper = App.Current.Container.Resolve <Microsoft.Toolkit.Uwp.Helpers.LocalObjectStorageHelper>(); localObjectStorageHelper.Save(secondary_view_size, _PrevSecondaryViewSize); } // セカンダリウィンドウを閉じるタイミングでキャッシュを再開する // プレミアム会員の場合は何もおきない var cacheManager = App.Current.Container.Resolve <VideoCacheManager>(); await cacheManager.ResumeCacheDownload(); }
private async void MainView_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { if (sender == MainView) { await CoreAppView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { if (AppView != null) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 4)) { await AppView.TryConsolidateAsync(); } else { App.Current.Exit(); } } }); } }
private void ReadingPage_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { }
static void Helper_Consolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { sender.Consolidated -= Helper_Consolidated; if (!CoreApplication.GetCurrentView().IsMain) Window.Current.Close(); }
void IApplicationViewEventSink.OnConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args) { }
// A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc. // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible. private void ViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs e) { StopViewInUse(); }
// A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc. // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible. private void ViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs e) { Consolidated = true; }