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" />
+
+
GetResource();
CommandBarFlyout Flyout6 => GetResource();
CommandBarFlyout Flyout7 => GetResource();
+ CommandBarFlyout Flyout8 => GetResource();
+ CommandBarFlyout Flyout9 => GetResource();
public CommandBarFlyoutPage()
{
@@ -148,6 +150,16 @@ private void OnFlyoutTarget7Click(object sender, RoutedEventArgs e)
ShowFlyoutAt(Flyout7, FlyoutTarget7);
}
+ private void OnFlyoutTarget8Click(object sender, RoutedEventArgs e)
+ {
+ ShowFlyoutAt(Flyout8, FlyoutTarget8);
+ }
+
+ private void OnFlyoutTarget9Click(object sender, RoutedEventArgs e)
+ {
+ ShowFlyoutAt(Flyout9, FlyoutTarget9);
+ }
+
private void ShowFlyoutAt(FlyoutBase flyout, FrameworkElement targetElement, FlyoutShowMode showMode = FlyoutShowMode.Transient)
{
//if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone5))
diff --git a/test/ModernWpfTestApp/CommandBarPage.xaml b/test/ModernWpfTestApp/CommandBarPage.xaml
index f182ea27..9e2476d6 100644
--- a/test/ModernWpfTestApp/CommandBarPage.xaml
+++ b/test/ModernWpfTestApp/CommandBarPage.xaml
@@ -36,18 +36,12 @@
-
+
-
-
-
-
-
-