diff --git a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs index 939f44d772..27ea1ffb15 100644 --- a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs +++ b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs @@ -68,22 +68,24 @@ namespace ControlCatalog.ViewModels this.WhenAnyValue(x => x.SystemChromeButtonsEnabled, x=>x.ManagedChromeButtonsEnabled, x => x.SystemTitleBarEnabled) .Subscribe(x => { - ChromeHints = ExtendClientAreaChromeHints.NoChrome | ExtendClientAreaChromeHints.OSXThickTitleBar; + var hints = ExtendClientAreaChromeHints.NoChrome | ExtendClientAreaChromeHints.OSXThickTitleBar; if(x.Item1) { - ChromeHints |= ExtendClientAreaChromeHints.SystemChromeButtons; + hints |= ExtendClientAreaChromeHints.SystemChromeButtons; } if(x.Item2) { - ChromeHints |= ExtendClientAreaChromeHints.ManagedChromeButtons; + hints |= ExtendClientAreaChromeHints.ManagedChromeButtons; } if(x.Item3) { - ChromeHints |= ExtendClientAreaChromeHints.SystemTitleBar; + hints |= ExtendClientAreaChromeHints.SystemTitleBar; } + + ChromeHints = hints; }); SystemTitleBarEnabled = true; diff --git a/src/Avalonia.Controls/Chrome/TitleBar.cs b/src/Avalonia.Controls/Chrome/TitleBar.cs index 23eefb5d1b..d4ac5cd855 100644 --- a/src/Avalonia.Controls/Chrome/TitleBar.cs +++ b/src/Avalonia.Controls/Chrome/TitleBar.cs @@ -2,6 +2,7 @@ using System.Reactive.Disposables; using Avalonia.Controls.Primitives; using Avalonia.Input; +using Avalonia.LogicalTree; using Avalonia.Media; namespace Avalonia.Controls.Chrome @@ -63,6 +64,8 @@ namespace Avalonia.Controls.Chrome PseudoClasses.Set(":fullscreen", x == WindowState.FullScreen); }) }; + + _captionButtons?.Attach(_hostWindow); } } diff --git a/src/Avalonia.Themes.Fluent/TitleBar.xaml b/src/Avalonia.Themes.Fluent/TitleBar.xaml index 6512ee342c..f7d9f1df10 100644 --- a/src/Avalonia.Themes.Fluent/TitleBar.xaml +++ b/src/Avalonia.Themes.Fluent/TitleBar.xaml @@ -30,15 +30,13 @@ - -