From 2cc40e3c6ab6958116d66d97f6bf8a3aab3c4a87 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Tue, 23 Jun 2020 17:39:00 -0300 Subject: [PATCH] add a prefer managed chrome to demo page --- .../Pages/WindowCustomizationsPage.xaml | 1 + .../ViewModels/MainWindowViewModel.cs | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml b/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml index cea8e4b94e..e3fdbeaa69 100644 --- a/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml +++ b/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml @@ -9,6 +9,7 @@ + None diff --git a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs index 27ea1ffb15..2dab49cf0a 100644 --- a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs +++ b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs @@ -65,7 +65,7 @@ namespace ControlCatalog.ViewModels WindowState.FullScreen, }; - this.WhenAnyValue(x => x.SystemChromeButtonsEnabled, x=>x.ManagedChromeButtonsEnabled, x => x.SystemTitleBarEnabled) + this.WhenAnyValue(x => x.SystemChromeButtonsEnabled, x=>x.ManagedChromeButtonsEnabled, x => x.SystemTitleBarEnabled, x=>x.PreferSystemChromeButtonsEnabled) .Subscribe(x => { var hints = ExtendClientAreaChromeHints.NoChrome | ExtendClientAreaChromeHints.OSXThickTitleBar; @@ -85,6 +85,11 @@ namespace ControlCatalog.ViewModels hints |= ExtendClientAreaChromeHints.SystemTitleBar; } + if(x.Item4) + { + hints |= ExtendClientAreaChromeHints.PreferSystemChromeButtons; + } + ChromeHints = hints; }); @@ -142,6 +147,13 @@ namespace ControlCatalog.ViewModels set { this.RaiseAndSetIfChanged(ref _managedChromeButtonsEnabled, value); } } + private bool _preferSystemChromeButtonsEnabled; + + public bool PreferSystemChromeButtonsEnabled + { + get { return _preferSystemChromeButtonsEnabled; } + set { this.RaiseAndSetIfChanged(ref _preferSystemChromeButtonsEnabled, value); } + } private double _titleBarHeight;