diff --git a/ModernWpf.Controls/CommandBar/CommandBar.xaml b/ModernWpf.Controls/CommandBar/CommandBar.xaml index 2b7b19a7..b289f6c7 100644 --- a/ModernWpf.Controls/CommandBar/CommandBar.xaml +++ b/ModernWpf.Controls/CommandBar/CommandBar.xaml @@ -60,7 +60,7 @@ Background="{TemplateBinding Background}"> - + diff --git a/ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.cs b/ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.cs index 8628d9ed..a9262d37 100644 --- a/ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.cs +++ b/ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.cs @@ -128,9 +128,23 @@ public CommandBarFlyout() { InternalPopup.SuppressFadeAnimation = true; - if (ShowMode == FlyoutShowMode.Standard) + if (m_commandBar is { } commandBar) { - m_commandBar.IsOpen = true; + if (ShowMode == FlyoutShowMode.Standard) + { + m_commandBar.IsOpen = true; + } + + // When CommandBarFlyout is in AlwaysOpen state, don't show the overflow button + if (AlwaysExpanded) + { + commandBar.IsOpen = true; + commandBar.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Collapsed; + } + else + { + commandBar.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Auto; + } } }; @@ -183,6 +197,8 @@ public CommandBarFlyout() }; } + public bool AlwaysExpanded { get; set; } + public ObservableCollection PrimaryCommands { get; } public ObservableCollection SecondaryCommands { get; } diff --git a/ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.xaml b/ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.xaml index 106a5768..cec3a358 100644 --- a/ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.xaml +++ b/ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.xaml @@ -798,7 +798,7 @@ - + 64 48 2,6,6,6 + 6 12,16,0,10 0,12,0,12 diff --git a/test/ModernWpfTestApp/CommandBarFlyoutPage.xaml b/test/ModernWpfTestApp/CommandBarFlyoutPage.xaml index 8e3625cd..5bffd717 100644 --- a/test/ModernWpfTestApp/CommandBarFlyoutPage.xaml +++ b/test/ModernWpfTestApp/CommandBarFlyoutPage.xaml @@ -171,6 +171,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -209,6 +231,8 @@ Content="Show CommandBarFlyout with non-focusable primary commands" Margin="10" Click="OnFlyoutTarget7Click" /> +