title: XAML Change the image source inside a Togglebutton
body: <p>I'm trying to change the image source (in XAML only) when the Togglebutton "IsPressed" is true. But when iam trying to bind that property via the ''Image.Trigger'' it's not working. </p>
  
  <p>This is what I have right now and the image is showing exactly like I want it to. </p>
  
  <pre><code>&lt;ToggleButton x:Name="pbStations"
                Template="{StaticResource ContentOnlyTemplateToggleButton}"&gt;
    &lt;StackPanel Orientation="Horizontal"&gt;
      &lt;Image Source="/Sprites/Misc/ExpanderButtonClose.png"
             Margin="2"
             Stretch="Uniform"
             x:Name="img"&gt;
      &lt;/Image&gt;
      &lt;TextBlock Text="STATIONS"
                 x:Name="tbStations"
                 Style="{StaticResource tbTriggerGray}" /&gt;
    &lt;/StackPanel&gt;
  &lt;/ToggleButton&gt;
  </code></pre>
  
  <p>This is what I have tried that doesn't work:</p>
  
  <pre><code>&lt;ToggleButton x:Name="pbStations"
                Template="{StaticResource ContentOnlyTemplateToggleButton}"&gt;
    &lt;StackPanel Orientation="Horizontal"&gt;
      &lt;Image Source="/Sprites/Misc/ExpanderButtonClose.png"
             Margin="2"
             Stretch="Uniform"
             x:Name="img"&gt;
        &lt;Image.Triggers&gt;
          &lt;DataTrigger Binding="{Binding ElementName=pbStations,Path=IsPressed}"
                       Value="True"&gt;
            &lt;Setter TargetName="img"
                    Property="Image.Source"
                    Value="/Sprites/Misc/ExpanderButtonOpen.png" /&gt;
          &lt;/DataTrigger&gt;
        &lt;/Image.Triggers&gt;
      &lt;/Image&gt;
      &lt;TextBlock Text="STATIONS"
                 x:Name="tbStations"
                 Style="{StaticResource tbTriggerGray}" /&gt;
    &lt;/StackPanel&gt;
  &lt;/ToggleButton&gt;
  </code></pre>