title: ToggleButton change background when pressed (but only once)
body: <p>When a button gets pressed the background (<code>Rectangle Fill</code>) of the button changes. So the user can see what buttons have been pressed and what not.</p>
  
  <p><strong>Problem:</strong></p>
  
  <p>I use a trigger and a <code>Togglebutton</code> to perform the <code>"IsChecked"</code> to change the  background.
  But the background change may only happens 1 time.</p>
  
  <p><em>For example:</em></p>
  
  <p>Button Background = black --> <code>PRESS</code> --> Button Background = blue</p>
  
  <p>But when i press the button again the Button BackGround changes back to black (since its a ToggleButton).</p>
  
  <p><em><strong>How can i make sure the background only changes 1 time?</em></strong></p>
  
  <p><strong>EDIT:</strong> The button must remain enabled, because a user gives in a reason when they press the button. Meaning if they pick the wrong reason they are able to change it.</p>
  
  <pre><code>&lt;Style x:Key="ButtonStyleReg" TargetType="{x:Type myClasses:RegButton}"&gt;
  &lt;Setter Property="Template"&gt;
      &lt;Setter.Value&gt;
          &lt;ControlTemplate TargetType="{x:Type ToggleButton}"&gt;
              &lt;Grid x:Name="registrationButton"&gt;
                  &lt;Rectangle Name="rectangleBtn" Fill="#FF89959A" Height="Auto" RadiusY="15" RadiusX="15" Stroke="White" Width="Auto"/&gt;
  
                  &lt;TextBlock x:Name="reason" TextWrapping="Wrap" 
                             Text="{Binding Reason, StringFormat=\{0\}}"
                             HorizontalAlignment="Center" Margin="0,7.5,0,0" Height="Auto" 
                             VerticalAlignment="Top" FontWeight="Bold" &gt;
                  &lt;/TextBlock&gt;                                                                                   
              &lt;/Grid&gt;
              &lt;ControlTemplate.Triggers&gt;
                  &lt;Trigger Property="IsFocused" Value="True"/&gt;
                  &lt;!--&lt;Trigger Property="IsDefaulted" Value="True"/&gt;--&gt;
  
                  &lt;Trigger Property="IsChecked" Value="True"&gt;
                      &lt;Setter TargetName="rectangleBtn" Property="Fill" Value="blue" /&gt;
                  &lt;/Trigger&gt;                                                     
                  &lt;Trigger Property="IsEnabled" Value="False"/&gt;
              &lt;/ControlTemplate.Triggers&gt;
          &lt;/ControlTemplate&gt;
  
      &lt;/Setter.Value&gt;
  &lt;/Setter&gt;
  &lt;Setter Property="FontSize" Value="10.667"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>Listbox that implements the style:</p>
  
  <pre><code>&lt;ListBox x:Name="lbRegistration" ItemsSource="{Binding RegBtns, ElementName=Window}" Background="{x:Null}" 
              BorderBrush="{x:Null}" Grid.Column="1" 
              ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" Height="75"&gt;
              &lt;ListBox.ItemsPanel&gt;
                  &lt;ItemsPanelTemplate&gt;
                      &lt;StackPanel Orientation="Horizontal"/&gt;
                  &lt;/ItemsPanelTemplate&gt;
              &lt;/ListBox.ItemsPanel&gt;
  
              &lt;ListBox.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;myClasses:RegistrationButton x:Name="RegistrationButton" HorizontalAlignment="Center" Height="71" Width="148" 
                                                    Margin="10,0,5,0" 
                                                    Style="{DynamicResource ButtonStyleRegistration}"
                                                    Click="RegistrationButton_Click"
                                                    Title="{Binding Title}"
                                                    Oorzaak="{Binding Oorzaak}"     
  
                                                    DuurStilstand="{Binding DuurStilstand, 
                                                          Converter={StaticResource  DateTimeConverter}}"
  
                                                    BeginStilstand="{Binding BeginStilstand}"/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
          &lt;/ListBox&gt;
  </code></pre>
  
  <p>Best Regards, 
  Pete</p>