How to set DropDownButton MenuItem.Icon when using a DataTemplate? #17947
-
I have the following code which allow me to create a View: <DropDownButton>
<DropDownButton.Content>
<StackPanel Orientation="Horizontal" Spacing="5">
<CheckBox IsChecked="{Binding AppSettings.NetworkInterfaces.EnableFilterTypes}"/>
<icon:MaterialIcon Kind="Filter"></icon:MaterialIcon>
<TextBlock Text="Type"/>
</StackPanel>
</DropDownButton.Content>
<DropDownButton.DataTemplates>
<DataTemplate DataType="{x:Type models:EnumViewFilter}">
<CheckBox IsChecked="{Binding Include}"
Content="{Binding Description}"
HorizontalContentAlignment="Stretch"
HorizontalAlignment="Stretch"/>
</DataTemplate>
</DropDownButton.DataTemplates>
<DropDownButton.Flyout>
<MenuFlyout ItemsSource="{Binding InterfaceTypeFilters}"
Placement="Right">
</MenuFlyout>
</DropDownButton.Flyout>
</DropDownButton> Produces: How can I set MenuItem.Icon via xaml? |
Beta Was this translation helpful? Give feedback.
Answered by
stevemonaco
Jan 11, 2025
Replies: 1 comment 1 reply
-
I would try either:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sn4k3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would try either:
MenuFlyout.ItemContainerTheme
. See docs