I want to have a switch in a menuItem of my AppShell.xaml (in addition to the usual text and icon). How can I do that while keeping the styles of the MenuItem ?
I used a DataTemplate in the Shell.MenuItemTemplate of my MenuItem but the result is just ugly as all the styles of the MenuItem are lost. The MenuItem created this way does not have the same font, text color, and font size than the other FlyoutItems and MenuItems of the Shell.
<MenuItem Text="MyMenuItem" Command="{Binding SwitchMode}">
<Shell.MenuItemTemplate>
<DataTemplate>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Label Text="{Binding Text}"/>
<Switch IsToggled="{Binding IsModeActivated}"/>
</StackLayout>
</DataTemplate>
</Shell.MenuItemTemplate>