I'm just diving into WPF and find this a little odd and frustrating to my style: Why can the value of something be a Resource but you can't set the value directly to what the Resource represents? Example:
This is valid:
<ToggleButton>
<ToggleButton.Resources>
<Image x:Key="cancelImage" Source="cancel.png" />
</ToggleButton.Resources>
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Content" Value="{DynamicResource cancelImage}" />
</Style>
</ToggleButton.Style>
</ToggleButton>
But this is not:
<ToggleButton>
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Content">
<Setter.Value>
<Image Source="cancel.png" />
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
</ToggleButton>
What is the difference? Why don't both work? I don't like having to create a "Resource" for some things because it divides my code up and can make it more difficult to read.
And yes, I do know my example can be simplified like this
<ToggleButton>
<Image Source="cancel.png" />
</ToggleButton>
but that's not the point.