i have a memory card game where i want on clicking on a button to bind the prorty button background to this is what i am doing:
<Button
Name="btn"
Click="Button_Click"
DataContext="{Binding}"
Height="65" Width="79"
Background="Black"/>
<DataTemplate.Triggers>
<Trigger SourceName="btn" Property="IsMouseCaptured" Value="True">
<Setter TargetName="btn" Property="Background" Value="Green"/>
<!--"{Binding Path=ButtonColor}"-->
</Trigger>
</DataTemplate.Triggers>
for a reason I'm too ignorant to understand it doesn't work (notice that the binding itself does works when i use the binding in the defult state)