Skip to content

Commit

Permalink
Extract AccessText for MenuItem to separated ControlTheme. Closes #371
Browse files Browse the repository at this point in the history
  • Loading branch information
SKProCH committed May 17, 2024
1 parent fa92171 commit cb29548
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Material.Styles/Resources/Themes/MenuItem.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
</Design.PreviewWith>

<converters:PlatformKeyGestureConverter x:Key="KeyGestureConverter" />

<ControlTheme x:Key="MaterialMenuItemStringAccessText" TargetType="AccessText"
BasedOn="{StaticResource MaterialAccessText}">
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Regular" />
</ControlTheme>

<ControlTheme x:Key="MaterialMenuItem" TargetType="MenuItem">
<Setter Property="Height" Value="48" />
Expand Down Expand Up @@ -91,13 +97,8 @@
<ContentPresenter.DataTemplates>
<DataTemplate DataType="system:String">
<AccessText Name="PART_MenuItemText"
Text="{Binding }">
<AccessText.Styles>
<Style Selector="AccessText">
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Regular" />
</Style>
</AccessText.Styles>
Text="{Binding }"
Theme="{StaticResource MaterialMenuItemStringAccessText}">
</AccessText>
</DataTemplate>
</ContentPresenter.DataTemplates>
Expand Down

0 comments on commit cb29548

Please sign in to comment.