From 68f1a56a37b66bff4a0ff79615af5a535c7b94fa Mon Sep 17 00:00:00 2001 From: Mohamed Hazem <72768725+mou-haz@users.noreply.github.com> Date: Sun, 29 Jun 2025 22:50:14 +0300 Subject: [PATCH 1/2] [Fix] Update CommandBarFlyou Style updated command bar flyout and appbar button style to be more like the winui counterparts minor test minor test --- .../Windows/CommandBar/AppBarButton.cs | 7 + .../CommandBarFlyout/CommandBarFlyout.cs | 3 +- .../CommandBarFlyout/CommandBarFlyout.xaml | 449 ++++++++++++------ .../CommandBarFlyoutToolBar.cs | 87 +++- .../Windows/CommandBarFlyoutPage.xaml.cs | 3 +- .../Themes/Controls/CommandBar.xaml | 7 +- 6 files changed, 390 insertions(+), 166 deletions(-) diff --git a/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBar/AppBarButton.cs b/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBar/AppBarButton.cs index 5b1a0663..2da7ae98 100644 --- a/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBar/AppBarButton.cs +++ b/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBar/AppBarButton.cs @@ -389,6 +389,7 @@ private void UpdateVisualState(bool useTransitions = true) UpdateCommonState(useTransitions); UpdateKeyboardAcceleratorTextVisibility(useTransitions); UpdateFlyoutState(useTransitions); + UpdatePrimaryLabelState(useTransitions); } private void UpdateCommonState(bool useTransitions = true) @@ -444,6 +445,12 @@ private void UpdateFlyoutState(bool useTransitions = true) VisualStateManager.GoToState(this, hasFlyout ? "HasFlyout" : "NoFlyout", useTransitions); } + private void UpdatePrimaryLabelState(bool useTransitions = true) + { + bool hasPrimaryLabel = !IsInOverflow && Label is not null; + VisualStateManager.GoToState(this, hasPrimaryLabel ? "HasPrimaryLabels" : "NoPrimaryLabels", useTransitions); + } + private AppBarElementVisualStateManager _vsm; } diff --git a/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBarFlyout/CommandBarFlyout.cs b/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBarFlyout/CommandBarFlyout.cs index 1728650b..7742b20b 100644 --- a/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBarFlyout/CommandBarFlyout.cs +++ b/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBarFlyout/CommandBarFlyout.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -141,7 +142,7 @@ public CommandBarFlyout() Opening += delegate { - InternalPopup.SuppressFadeAnimation = true; + //InternalPopup.SuppressFadeAnimation = true; if (ShowMode == FlyoutShowMode.Standard) { diff --git a/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBarFlyout/CommandBarFlyout.xaml b/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBarFlyout/CommandBarFlyout.xaml index 3854d2e9..c70775d3 100644 --- a/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBarFlyout/CommandBarFlyout.xaml +++ b/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/CommandBarFlyout/CommandBarFlyout.xaml @@ -24,10 +24,8 @@ - - + - @@ -46,21 +44,37 @@ BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" /> - + - - - + + + + + + + + + + @@ -137,6 +152,13 @@ + + + + + + + @@ -147,6 +169,7 @@ + @@ -154,6 +177,7 @@ + @@ -166,6 +190,7 @@ + @@ -178,6 +203,7 @@ + @@ -187,16 +213,19 @@ + + + @@ -234,6 +263,13 @@ + + + + + + + @@ -755,18 +791,22 @@ Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}" SnapsToDevicePixels="True"> + + Visible + + CornerRadius="{TemplateBinding CornerRadius}" + Padding="{TemplateBinding BorderThickness}"/> + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" > + @@ -781,6 +821,19 @@ + 0,0,0,1 + + 00:00:00.250 + 00:00:00.167 + 00:00:00.168 + 00:00:00.083 + + 00:00:00.150 + + 00:00:00.250 + 00:00:00.167 + 00:00:00.168 +