I know there are other threads about this but in my case its a bit different.
I like to use an icon from a separate resource assembly
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsCheckable"
Value="true" />
<Condition Property="IsChecked"
Value="true" />
<Condition Property="Role"
Value="SubmenuItem" />
</MultiTrigger.Conditions>
<Setter Property="Icon">
<Setter.Value>
<Image Margin="1,0"
Width="16"
Source="pack://application:,,,/MyResourceAssembly;
component/Resources/Connect_24.png"/>
</Setter.Value>
</Setter>
</MultiTrigger>
This is used inside
<Style TargetType="{x:Type MenuItem}">
I tried the x:Share too but this didn't work cause of ResourceDictionary in a ResourceDictionary.
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MyResourceAssembly;component/Resources.xaml" />
<ResourceDictionary>
<Image x:Key="ConnectedIcon"
x:Shared="false"
Margin="1,0"
Width="16"
Source="pack://application:,,,/MyResourceAssembly;component/Resources/Connect_24.png"/>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
Do anybody has an idea to solve this problem. Adding the icon to any entry separately didn't solve the issue for me, cause in my application are about 200 items.
Best Regards