The easiest way is not to use the Icon property, but instead put the icon in the header:
<Menu> <MenuItem> <MenuItem.Header> <StackPanel> <Image Width="20" Height="20" Source="/XSoftArt.WPFengine;component/Images/export32x32xp.png" /> <ContentPresenter Content="Reports" /> </StackPanel> </MenuItem.Header> </MenuItem> <MenuItem Header="Export" /> <MenuItem Header="New record" /> </Menu>
In this simple case, <ContentPresenter Content="Reports" /> can be replaced with <TextBlock Text="Reports" /> , because what ContentPresenter will use to represent the string anyway. For more complex Header= you can use ContentPresenter as shown.
Ray Burns Nov 19 '09 at 14:48 2009-11-19 14:48
source share