I am working on a C# WPF application, using .resx files for resource management. Now, I'm trying to add icons (.ico) to the project but I'm running into some problems.
<Image Name="imgMin" Grid.Column="0"
Stretch="UniformToFill"
Cursor="Hand"
MouseDown="imgMin_MouseDown">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="Source" Value="\Images\minimize_glow.ico"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Source" Value="\Images\minimize_glow.ico"/>
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
This works fine, but when I move the icon into AppResources.resx I run into problems with referencing it in the xaml code. What should I be using instead of the Setter Property=... lines above? This:
<Setter Property="Source" Value="{x:Static res:AppResources.minimize}"/>
doesn't work, I think I probably need to use a different Property than "Source" because Value isn't a string pointing to the icon but the icon itself now. I can't figure out which one to use though - some help, please?