I have a WPF test project which i use for answering SO questions, somehow this project got quite cluttered over time and some stuff does not work correctly anymore.This may not be a real problem since i can just throw it away and create a new one but obviously that is not quite a viable solution in every case so i thought it might be interesting to know what can cause such behavior.
Especially surprising is that even the explicit styles do not apply. e.g. i have this style
<Style x:Key="EnlargeImageStyle" TargetType="{x:Type Image}">
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="{Binding RelativeSource={RelativeSource Self}, Path=ScaleX}"/>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="2" Duration="0:0:0.3"
Storyboard.TargetProperty="LayoutTransform.ScaleX"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="1" Duration="0:0:0.3"
Storyboard.TargetProperty="LayoutTransform.ScaleX"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</Style.Triggers>
</Style>
Which is define in the Window.Resources
and i apply it to a minimally defined Image like this:
<Image Width="80" Height="48" Style="{StaticResource EnlargeImageStyle}">
<Image.Source>
<BitmapImage UriSource="pack://application:,,,/Images/Img.png"/>
</Image.Source>
</Image>
And it just won't do anything, if i try to apply it implicitly i also get no results.
So as the title states, what could prevent explicit and implicit styles from applying?
(I do not want to restrict this to my problem, any reason that one could possibly encounter in the wild is fine)