Skip to content

How to fix icon in contexmenu in material design in XAML toolkit? #3072

Closed Answered by Keboo
VahidEra asked this question in Q&A
Discussion options

You must be logged in to vote

At present the reason it is being clipped is because in the MenuItem template the icon container is declared with a fixed Width and Height of 16 like this:

<ContentPresenter x:Name="Icon"
                  Width="16"
                  Height="16"
                  HorizontalAlignment="Left"
                  VerticalAlignment="Center"
                  Content="{TemplateBinding Icon}"
                  ContentSource="Icon"
                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />

So your icon with a size of 30 is being clipped. That fixed sizing is probably in correct and should really be changed so that when the menu height is increased (like in your example) the i…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@VahidEra
Comment options

Answer selected by VahidEra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants