Hello,
Welcome to our Microsoft Q&A platform!
I used your style in the shell(this logout item) like following screenshot.
]2
MenuItemLayoutStyleSeparator
style not worked for Label
in the Shell.MenuItemTemplate
.
So, we can create another style for Label
.
<Style x:Key="labelWihteStyle" TargetType="Label">
<Setter Property="Label.TextColor" Value="White" />
<Setter Property="BackgroundColor" Value="#bcbcbc" />
</Style>
Then use it in the MenuItemTemplate
like following code
<MenuItem Text="Logout" StyleClass="MenuItemLayoutStyleSeparator" Clicked="OnMenuItemClicked">
<Shell.MenuItemTemplate>
<DataTemplate>
<Label
Margin="0,5,10,5"
Style="{StaticResource labelWihteStyle}"
Text="{Binding Text}"
FontAttributes="Italic"
VerticalTextAlignment="Center" />
</DataTemplate>
</Shell.MenuItemTemplate>
</MenuItem>
Here is running screenshot.
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.