I want to use the same style for all Image
s and AutoGreyableImage
s (my custom control that inherits from Image
). I have the following style declared application-wide:
<Style TargetType="{x:Type Image}"
x:Key="ImageType">
<Setter Property="Stretch"
Value="Uniform" />
<Setter Property="Height"
Value="16" />
<Setter Property="Width"
Value="16" />
<Setter Property="SnapsToDevicePixels"
Value="True" />
</Style>
But the AutoGreyableImage
s don't accept the style. This doesn't work either:
<Style TargetType="{x:Type my:AutoGreyableImage}"
BasedOn="{DynamicResource ImageType}" />
What is the correct way to do this?