Skip to content

Commit 8c4630e

Browse files
mergify[bot]kazo0
andauthored
fix: navigationbar commandbar staticresources (#1385) (#1386)
Co-authored-by: Steve Bilogan <[email protected]>
1 parent b6bc500 commit 8c4630e

File tree

2 files changed

+24
-27
lines changed

2 files changed

+24
-27
lines changed

src/Uno.Toolkit.UI/Controls/NavigationBar/NavigationBarPresenter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ void setBinding(UIElement target, object source, DependencyProperty property, st
112112
setBinding(_commandBar, navigationBar, CommandBar.FontFamilyProperty, nameof(navigationBar.FontFamily));
113113
setBinding(_commandBar, navigationBar, CommandBar.FontSizeProperty, nameof(navigationBar.FontSize));
114114
setBinding(_commandBar, navigationBar, CommandBar.WidthProperty, nameof(navigationBar.Width));
115-
setBinding(_commandBar, navigationBar, CommandBar.HeightProperty, nameof(navigationBar.Height));
116115
setBinding(_commandBar, navigationBar, CommandBar.UseSystemFocusVisualsProperty, nameof(navigationBar.UseSystemFocusVisuals));
117116
setBinding(_commandBar, navigationBar, CommandBarExtensions.MainCommandProperty, nameof(navigationBar.MainCommand));
118117

src/library/Uno.Toolkit.Material/Styles/Controls/v2/NavigationBar.xaml

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,6 @@
6767
<SolidColorBrush x:Key="NavigationBarEllipsisButtonBackground"
6868
Color="Transparent" />
6969

70-
<not_mobile:StaticResource x:Key="AppBarButtonHeight"
71-
ResourceKey="MaterialXamlNavigationBarHeight" />
72-
<not_mobile:StaticResource x:Key="AppBarButtonWidth"
73-
ResourceKey="MaterialXamlNavigationBarHeight" />
74-
75-
<mobile:StaticResource x:Key="AppBarButtonHeight"
76-
ResourceKey="MaterialNavigationBarHeight" />
77-
<mobile:StaticResource x:Key="AppBarButtonWidth"
78-
ResourceKey="MaterialNavigationBarHeight" />
79-
8070
<x:Double x:Key="MaterialNavigationBarElevation">4</x:Double>
8171
<x:Double x:Key="MaterialXamlNavigationBarHeight">64</x:Double>
8272
<x:Double x:Key="MaterialNavigationBarHeight">64</x:Double>
@@ -89,10 +79,8 @@
8979
<StaticResource x:Key="NavigationBarMaterialEllipsisButtonWidth" ResourceKey="AppBarExpandButtonThemeWidth" />
9080

9181
<x:Double x:Key="NavBarAppBarButtonContentHeight">16</x:Double>
92-
<StaticResource x:Key="AppBarButtonContentHeight" ResourceKey="NavBarAppBarButtonContentHeight" />
9382
<x:Double x:Key="NavBarMainCommandAppBarButtonContentHeight">24</x:Double>
9483
<x:Double x:Key="NavBarAppBarThemeCompactHeight">64</x:Double>
95-
<StaticResource x:Key="AppBarThemeCompactHeight" ResourceKey="NavBarAppBarThemeCompactHeight" />
9684
<Thickness x:Key="NavBarAppBarButtonPadding">12,16,12,16</Thickness>
9785
<Visibility x:Key="NavBarAppBarButtonHasFlyoutChevronVisibility">Collapsed</Visibility>
9886
<x:String x:Key="NavigationBarBackIconData">M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z</x:String>
@@ -136,15 +124,6 @@
136124
<SolidColorBrush x:Key="NavigationBarEllipsisButtonBackground"
137125
Color="Transparent" />
138126

139-
<not_mobile:StaticResource x:Key="AppBarButtonHeight"
140-
ResourceKey="MaterialXamlNavigationBarHeight" />
141-
<not_mobile:StaticResource x:Key="AppBarButtonWidth"
142-
ResourceKey="MaterialXamlNavigationBarHeight" />
143-
144-
<mobile:StaticResource x:Key="AppBarButtonHeight"
145-
ResourceKey="MaterialNavigationBarHeight" />
146-
<mobile:StaticResource x:Key="AppBarButtonWidth"
147-
ResourceKey="MaterialNavigationBarHeight" />
148127

149128
<x:Double x:Key="MaterialNavigationBarElevation">4</x:Double>
150129
<x:Double x:Key="MaterialXamlNavigationBarHeight">64</x:Double>
@@ -158,10 +137,8 @@
158137
<StaticResource x:Key="NavigationBarMaterialEllipsisButtonWidth" ResourceKey="AppBarExpandButtonThemeWidth" />
159138

160139
<x:Double x:Key="NavBarAppBarButtonContentHeight">16</x:Double>
161-
<StaticResource x:Key="AppBarButtonContentHeight" ResourceKey="NavBarAppBarButtonContentHeight" />
162140
<x:Double x:Key="NavBarMainCommandAppBarButtonContentHeight">24</x:Double>
163141
<x:Double x:Key="NavBarAppBarThemeCompactHeight">64</x:Double>
164-
<StaticResource x:Key="AppBarThemeCompactHeight" ResourceKey="NavBarAppBarThemeCompactHeight" />
165142
<Thickness x:Key="NavBarAppBarButtonPadding">12,16,12,16</Thickness>
166143
<Visibility x:Key="NavBarAppBarButtonHasFlyoutChevronVisibility">Collapsed</Visibility>
167144
<x:String x:Key="NavigationBarBackIconData">M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z</x:String>
@@ -293,6 +270,7 @@
293270
<CommandBar x:Name="XamlNavigationBarCommandBar"
294271
Content="{TemplateBinding Content}"
295272
Margin="{TemplateBinding Padding}"
273+
Height="{ThemeResource NavBarAppBarThemeCompactHeight}"
296274
Style="{StaticResource MaterialNavigationBarCommandBar}" />
297275
</Grid>
298276
</ControlTemplate>
@@ -339,16 +317,25 @@
339317
Value="0" />
340318
</DoubleAnimationUsingKeyFrames>
341319
</Storyboard>
342-
<!--<StaticResource x:Key="AppBarButtonContentHeight" ResourceKey="NavBarAppBarButtonContentHeight" />-->
320+
<StaticResource x:Key="AppBarButtonContentHeight" ResourceKey="NavBarAppBarButtonContentHeight" />
343321
<StaticResource x:Key="AppBarThemeCompactHeight" ResourceKey="NavBarAppBarThemeCompactHeight" />
344322
<Style BasedOn="{StaticResource SplitButtonCommandBarStyle}"
345323
TargetType="SplitButton" />
346324
<Style BasedOn="{StaticResource SplitButtonCommandBarStyle}"
347325
TargetType="ToggleSplitButton" />
348326
<Style BasedOn="{StaticResource MaterialAppBarButtonStyle}"
349327
TargetType="AppBarButton">
350-
<!--<Setter Property="Padding" Value="{ThemeResource NavBarAppBarButtonPadding}" />-->
351328
</Style>
329+
330+
<not_mobile:StaticResource x:Key="AppBarButtonHeight"
331+
ResourceKey="MaterialXamlNavigationBarHeight" />
332+
<not_mobile:StaticResource x:Key="AppBarButtonWidth"
333+
ResourceKey="MaterialXamlNavigationBarHeight" />
334+
335+
<mobile:StaticResource x:Key="AppBarButtonHeight"
336+
ResourceKey="MaterialNavigationBarHeight" />
337+
<mobile:StaticResource x:Key="AppBarButtonWidth"
338+
ResourceKey="MaterialNavigationBarHeight" />
352339
</Grid.Resources>
353340
<Grid x:Name="ContentRoot"
354341
Height="{TemplateBinding Height}"
@@ -719,6 +706,7 @@
719706
</Setter.Value>
720707
</Setter>
721708
</Style>
709+
722710
<!--#endregion-->
723711

724712
<!--#region Default Modal Material NavigationBar-->
@@ -763,6 +751,7 @@
763751
<CommandBar x:Name="XamlNavigationBarCommandBar"
764752
Content="{TemplateBinding Content}"
765753
Margin="{TemplateBinding Padding}"
754+
Height="{ThemeResource NavBarAppBarThemeCompactHeight}"
766755
Style="{StaticResource MaterialPrimaryNavigationBarCommandBar}" />
767756
</Grid>
768757
</ControlTemplate>
@@ -817,8 +806,17 @@
817806
TargetType="ToggleSplitButton" />
818807
<Style BasedOn="{StaticResource MaterialPrimaryAppBarButtonStyle}"
819808
TargetType="AppBarButton">
820-
<Setter Property="Padding" Value="{ThemeResource NavBarAppBarButtonPadding}" />
821809
</Style>
810+
811+
<not_mobile:StaticResource x:Key="AppBarButtonHeight"
812+
ResourceKey="MaterialXamlNavigationBarHeight" />
813+
<not_mobile:StaticResource x:Key="AppBarButtonWidth"
814+
ResourceKey="MaterialXamlNavigationBarHeight" />
815+
816+
<mobile:StaticResource x:Key="AppBarButtonHeight"
817+
ResourceKey="MaterialNavigationBarHeight" />
818+
<mobile:StaticResource x:Key="AppBarButtonWidth"
819+
ResourceKey="MaterialNavigationBarHeight" />
822820
</Grid.Resources>
823821
<Grid x:Name="ContentRoot"
824822
Height="{TemplateBinding Height}"

0 commit comments

Comments
 (0)