title: Usage DataTrigger in WPF
body: <p>I have a <code>TextBox</code> control defined in XAML and I want to apply different background colors to the <code>TextBox</code> based on its IsReadOnly or IsEnabled properties. I used dataTriggers to actually switch between the colors as shown below:</p>
  
  <pre><code>&lt;Style x:Key="TextBoxStyle" TargetType="TextBox"&gt;
      &lt;Style.Triggers&gt;
          &lt;DataTrigger Binding="{Binding IsEnabled}" Value="True"&gt;
              &lt;Setter Property="TextBox.Background" Value="Yellow"/&gt;
          &lt;/DataTrigger&gt;
          &lt;DataTrigger Binding="{Binding IsReadOnly}" Value="True"&gt;
              &lt;Setter Property="TextBox.Background" Value="Red"/&gt;
          &lt;/DataTrigger&gt;
          &lt;MultiDataTrigger&gt;
              &lt;MultiDataTrigger.Conditions&gt;
                  &lt;Condition Binding="{Binding IsReadOnly}" Value="True"/&gt;
                  &lt;Condition Binding="{Binding IsEnabled}" Value="True"/&gt;
              &lt;/MultiDataTrigger.Conditions&gt;
              &lt;Setter Property="Background" Value="Green"/&gt;
          &lt;/MultiDataTrigger&gt;
      &lt;/Style.Triggers&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>And the TextBox is defined as shown below:</p>
  
  <pre><code>  &lt;TextBox Name="sourceTextBox"  Margin="5,3,5,3" IsReadOnly="True" Style="{StaticResource TextBoxStyle}" /&gt;
  </code></pre>
  
  <p>But the problem is, the colors are not being applied properly.</p>
  
  <p>Is there any problem with the above approach?</p>