title: UWP ToggleButton image depending on IsChecked
body: <p>I am trying to give my <code>ToggleButton</code> a different image depending on the <code>IsChecked</code> state of the <code>ToggleButton</code>, but in UWP Style triggers no longer exist, so it has to be done in a different way.</p>
  
  <p>I ran into discussions where the supposed solution is to use <code>DataTriggerBehavior</code>, but I am getting nowhere.</p>
  
  <p>What I want to achieve (blue is unchecked, green is checked):</p>
  
  <p><a href="https://i.stack.imgur.com/7zWVo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7zWVo.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/uUd5A.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uUd5A.jpg" alt="enter image description here"></a></p>
  
  <p>Is the following in the good direction? </p>
  
  <pre><code>&lt;ToggleButton 
      x:Name="ToggleButton"
      IsChecked="{Binding SignalButtonSelected, Mode=TwoWay}"
      Command="{Binding SignalButtonCommand}"&gt;
      &lt;Grid&gt;
      &lt;Image x:Name="IsCheckedImage" Source="Images/Buttons/Button signal.png"&gt;
          &lt;Interactivity:Interaction.Behaviors&gt;
              &lt;Core:DataTriggerBehavior Binding="{Binding IsChecked, ElementName=ToggleButton}" Value="True"&gt;
                  &lt;Core:ChangePropertyAction TargetObject="{Binding ElementName=IsCheckedImage}" PropertyName="Visibility" Value="Collapsed" /&gt;
              &lt;/Core:DataTriggerBehavior&gt;
          &lt;/Interactivity:Interaction.Behaviors&gt;
      &lt;/Image&gt;
      &lt;Image x:Name="IsUncheckedImage" Source="Images/Buttons/Button electric ns.png"&gt;
          &lt;Interactivity:Interaction.Behaviors&gt;
              &lt;Core:DataTriggerBehavior Binding="{Binding IsChecked, ElementName=ToggleButton}" Value="False"&gt;
                  &lt;Core:ChangePropertyAction TargetObject="{Binding ElementName=IsUncheckedImage}" PropertyName="Visibility" Value="Collapsed" /&gt;
              &lt;/Core:DataTriggerBehavior&gt;
          &lt;/Interactivity:Interaction.Behaviors&gt;
      &lt;/Image&gt;
      &lt;/Grid&gt;
  &lt;/ToggleButton&gt;
  </code></pre>
  
  <p>Or is there a better / easier way to achieve this? I also read something about VisualStateManager, which I also have zero experience with... </p>
  
  <p>Hope that somebody can push me in the right direction...</p>