Specify a size for ContextMenu MenuItem Icon
I defined a WPF ContextMenu
MenuItem
Icon
.
Now I see 开发者_运维技巧in this menu images(icons) of different sizes...
Could I explicitly set the icon size of this item?
Yes, you can specify the width and the heigth of your images :
<ContextMenu>
<MenuItem>
<MenuItem.Icon>
<Image Width="50" Height="50" Source="..." />
</MenuItem.Icon>
</MenuItem>
<MenuItem>
<MenuItem.Icon>
<Image Width="50" Height="50" Source="..." />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
精彩评论