Skip to content

Commit b735741

Browse files
committed
chore: Small adjustments
1 parent be68409 commit b735741

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

src/Uno.UI/UI/Xaml/Controls/CommandBar/CommandBar.Partial.cs

+7-9
Original file line numberDiff line numberDiff line change
@@ -1594,8 +1594,7 @@ private void OnOverflowContentKeyDown(object sender, KeyRoutedEventArgs e)
15941594

15951595
internal static void OnCommandExecutionStatic(ICommandBarElement element)
15961596
{
1597-
CommandBar? parentCmdBar;
1598-
FindParentCommandBarForElement(element, out parentCmdBar);
1597+
var parentCmdBar = FindParentCommandBarForElement(element);
15991598

16001599
if (parentCmdBar is { })
16011600
{
@@ -1605,8 +1604,7 @@ internal static void OnCommandExecutionStatic(ICommandBarElement element)
16051604

16061605
internal static void OnCommandBarElementVisibilityChanged(ICommandBarElement element)
16071606
{
1608-
CommandBar? parentCmdBar;
1609-
FindParentCommandBarForElement(element, out parentCmdBar);
1607+
var parentCmdBar = FindParentCommandBarForElement(element);
16101608

16111609
if (parentCmdBar is { })
16121610
{
@@ -1889,11 +1887,11 @@ protected override void UpdateTemplateSettings()
18891887
{
18901888
if (element is AppBarButton elementAsAppBarButton)
18911889
{
1892-
elementAsAppBarButton.UpdateTemplateSettings(maxAppBarKeyboardAcceleratorTextWidth);
1890+
AppBarButtonHelpers<AppBarButton>.UpdateTemplateSettings<AppBarButtonTemplateSettings>(elementAsAppBarButton, maxAppBarKeyboardAcceleratorTextWidth);
18931891
}
18941892
else if (element is AppBarToggleButton elementAsAppBarToggleButton)
18951893
{
1896-
elementAsAppBarToggleButton.UpdateTemplateSettings(maxAppBarKeyboardAcceleratorTextWidth);
1894+
AppBarButtonHelpers<AppBarToggleButton>.UpdateTemplateSettings<AppBarToggleButtonTemplateSettings>(elementAsAppBarToggleButton, maxAppBarKeyboardAcceleratorTextWidth);
18971895
}
18981896
}
18991897
}
@@ -2611,7 +2609,7 @@ private void FireDynamicOverflowItemsChangingEvent(bool isForceToRestore)
26112609

26122610
internal static bool IsCommandBarElementInOverflow(ICommandBarElement element)
26132611
{
2614-
FindParentCommandBarForElement(element, out var parentCmdBar);
2612+
var parentCmdBar = FindParentCommandBarForElement(element);
26152613
bool isInOverflow = false;
26162614

26172615
if (parentCmdBar is { })
@@ -2646,7 +2644,7 @@ internal static int GetPositionInSetStatic(ICommandBarElement element)
26462644
{
26472645
int positionInSet = -1;
26482646

2649-
FindParentCommandBarForElement(element, out var parentCommandBar);
2647+
var parentCommandBar = FindParentCommandBarForElement(element);
26502648

26512649
if (parentCommandBar is { })
26522650
{
@@ -2746,7 +2744,7 @@ internal static int GetSizeOfSetStatic(ICommandBarElement element)
27462744
{
27472745
int sizeOfSet = -1;
27482746

2749-
FindParentCommandBarForElement(element, out var parentCommandBar);
2747+
var parentCommandBar = FindParentCommandBarForElement(element);
27502748

27512749
if (parentCommandBar is { })
27522750
{

src/Uno.UI/UI/Xaml/Controls/CommandBar/ICommandBarOverflowElement.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
using System.Collections.Generic;
33
using System.Text;
44

5-
namespace Microsoft.UI.Xaml.Controlsů
5+
namespace Microsoft.UI.Xaml.Controls;
6+
7+
internal interface ICommandBarOverflowElement
68
{
7-
internal interface ICommandBarOverflowElement
8-
{
9-
bool UseOverflowStyle { get; set; }
10-
}
9+
bool UseOverflowStyle { get; set; }
1110
}

0 commit comments

Comments
 (0)