Reputation: 13
is there a shorter way to get the icon from a resourceassembly? Something like the way for the Header property?
<MenuItem Header="{x:Static resx:Resource.Menue_Menue}">
<MenuItem Header="{x:Static resx:Resource.Menue_Exit}" Command="{Binding ExitProgramCommand}">
<MenuItem.Icon>
<Image>
<Image.Source>
<BitmapImage UriSource="/Blubb.Resources;component/Icons/IconExit.ico" />
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
Thanks in advance.
Upvotes: 1
Views: 2555
Reputation: 1892
Sure, you can remove some code and have the same result:
<MenuItem Header="{x:Static resx:Resource.Menue_Exit}" Command="{Binding ExitProgramCommand}">
<MenuItem.Icon>
<Image Source="/Icons/IconExit.ico" />
</MenuItem.Icon>
</MenuItem>
Upvotes: 4