title: Why does assigning a background color to a control override the style trigger?
body: <p>I've got a simple WPF window with a label. There is a default style in the window that changes the label background to red when a mouse is over the label. Pretty simple. </p>
  
  <p>This works, as long as I don't set/modify the labels color to anything, anywhere. </p>
  
  <ul>
  <li>If I set the labels background in code behind (via the 'Set Label Background' button in the code below) the style trigger stops working</li>
  <li>If I set the labels background in XAML (not shown, but an easy edit) the style does not work. </li>
  <li>If, after setting the labels color in code behind, I try to revert the background to what it was (whether null or transparent), the trigger goes from working, to not working. </li>
  </ul>
  
  <p>I don't understand why setting the background seems to override the style. </p>
  
  <p>What I'd prefer this to do is to keep the style active regardless of what background I set for the label - If I move the mouse over, it should change colors to red, regardless of if I've set it to blue or anything else. I'm OK if I have to create the trigger in code behind. </p>
  
  <p>Instead, it seems like merely by assigning a background color to the label, I overwrite the style. </p>
  
  <p>Here is the XAML : 
          
          
              
                  
                      
                  
              
          
          </p>
  
  <pre><code>    &lt;Grid Background="Black"&gt;   
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
          &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
          &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Button Grid.Column="0" Grid.Row="0" Margin="10,10,10,10" Height="75" Click="Button_Set_Click"&gt;Set Label Background&lt;/Button&gt;
      &lt;Button Grid.Column="0" Grid.Row="1" Margin="10,10,10,10" Height="75" Click="Button_Clear_Click"&gt;Clear Label Background&lt;/Button&gt;
      &lt;Label Name="TestLabel" Grid.Row="2"  Margin="10,10,10,10" BorderBrush="Gray" BorderThickness="5"&gt;&lt;/Label&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>Here is the code behind : </p>
  
  <pre><code>public partial class WpfProblems : Window
  {
      public WpfProblems()
      {
          InitializeComponent();
      }
  
      private void Button_Clear_Click(object sender, RoutedEventArgs e)
      {
          // revert the label background color - I've tried setting to null, transparent also
          // but the trigger never comes back. 
          TestLabel.Background = (Brush)new BrushConverter().ConvertFrom("#00FFFFFF");            
      }
  
      private void Button_Set_Click(object sender, RoutedEventArgs e)
      {
          // Set the label background color
          TestLabel.Background = Brushes.Blue;
      }
  }
  </code></pre>