tags:

views:

29

answers:

1

It was my understanding that this:

<Style TargetType="{x:Type Image}">
  <Setter Property="Margin" Value="0"/>
  <Setter Property="Stretch" Value="None"/>
  <Setter Property="HorizontalAlignment" Value="Center"/>
  <Setter Property="VerticalAlignment" Value="Center"/>
  <Setter Property="Cursor" Value="Help"/>   
</Style>

would change the default image settings for each image rendered on the Window. Is this not the case? Is there an exception for images as it appears to work with other controls?

TIA

+1  A: 

To set a style for a type you actually need to set the x:Key attribute like so:

<Style x:Key="{x:Type Image}" TargetType="{x:Type Image}">
    <!-- setters here -->
</Style>
Drew Marsh
Thank you Drew!
Brad
Glad I could help. ;)
Drew Marsh