private void AppWindow_Changed(AppWindow sender, AppWindowChangedEventArgs args) { if (args.DidSizeChange) { TryExitFullScreen(); } }
private void AppWindowChangedHandler(AppWindow sender, AppWindowChangedEventArgs args) { // The presenter changed so we need to update the button captions to reflect the new state if (args.DidPresenterChange) { switch (_mainAppWindow.Presenter.Kind) { case AppWindowPresenterKind.CompactOverlay: CompactoverlaytBtn.Content = "Exit CompactOverlay"; FullscreenBtn.Content = "Enter FullScreen"; break; case AppWindowPresenterKind.FullScreen: CompactoverlaytBtn.Content = "Enter CompactOverlay"; FullscreenBtn.Content = "Exit FullScreen"; break; case AppWindowPresenterKind.Overlapped: CompactoverlaytBtn.Content = "Enter CompactOverlay"; FullscreenBtn.Content = "Enter FullScreen"; break; default: // If we end up here the presenter was changed to something we don't know what it is. // This would happen if a new presenter is introduced. // We can ignore this situation since we are not aware of the presenter and have no UI that // reacts to this unknown presenter. break; } } }
private void MainAppWindow_Changed(AppWindow sender, AppWindowChangedEventArgs args) { if (args.DidSizeChange && sender.TitleBar.ExtendsContentIntoTitleBar) { // Need to update our drag region if the size of the window changes SetDragRegionForCustomTitleBar(sender); } }
private void AppWindow_Changed(AppWindow sender, AppWindowChangedEventArgs args) { // InputActivationListener.CreateForApplicationWindow throws an exception if called too early // Delay it until the window visibility has changed if (args.DidVisibilityChange && _appWindowActivationListener == null) { _appWindowActivationListener = InputActivationListenerPreview.CreateForApplicationWindow(_window); _windowActivated = _appWindowActivationListener.State != InputActivationState.Deactivated; _appWindowActivationListener.InputActivationChanged += AppWindow_InputActivationChanged; UpdateBrush(); } }
private void AppWindowChangedHandler(AppWindow sender, AppWindowChangedEventArgs args) { // The presenter changed so we need to update the button captions to reflect the new state if (args.DidPresenterChange) { switch (_mainAppWindow.Presenter.Kind) { case AppWindowPresenterKind.CompactOverlay: toggleCompactOverlay.Text = "Exit CompactOverlay"; toggleFullScreen.Text = "Enter FullScreen"; break; case AppWindowPresenterKind.FullScreen: toggleCompactOverlay.Text = "Enter CompactOverlay"; toggleFullScreen.Text = "Exit FullScreen"; break; case AppWindowPresenterKind.Overlapped: toggleCompactOverlay.Text = "Enter CompactOverlay"; toggleFullScreen.Text = "Enter FullScreen"; break; default: // If we end up here the presenter was changed to something we don't know what it is. // This would happen if a new presenter is introduced. // We can ignore this situation since we are not aware of the presenter and have no UI that // reacts to this unknown presenter. break; } } if (args.DidSizeChange && sender.TitleBar.ExtendsContentIntoTitleBar) { // Need to update our drag region if the size of the window changes SetDragRegionForCustomTitleBar(sender); } if (args.DidSizeChange) { // update the size of custom titlebar as the window size changes MyTitleBar.Width = _mainAppWindow.Size.Width; } }
void OnAppWindowChanged(AppWindow sender, AppWindowChangedEventArgs args) => WindowDisplayPropertiesChanged();
void OnAppWindowChanged(AppWindow sender, AppWindowChangedEventArgs args) => OnMainDisplayInfoChanged();