title: WPF TextBox in IsEnabled="False" state is not applying correct background color
body: <p>I'm having issue with applying colour to my textbox when it is disabled, </p>
  
  <p>acctualy I have datagrid and I coloured row's with <code>"#E0E4E5"</code> colour. And I would like to keep colour of my  textbox when it is disabled like colour of row is (<code>"#E0E4E5"</code>).</p>
  
  <p>What I did is next:</p>
  
  <p>I set property to row  <code>AlternatingRowBackground="#E0E4E5"</code> and Than I get this colour as row's background color.</p>
  
  <p>After that I did next, I made style for my textbox because default one in wpf doesnt look nice, it has some shadows etc, so here is my custom style for textbox:</p>
  
  <pre><code>  &lt;Style x:Key="TextBoxStyle1" TargetType="{x:Type TextBox}"&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="IsEnabled" Value="False"&gt;
                  &lt;Setter Property="Background" Value="#E0E4E5" /&gt;
                  &lt;Setter Property="BorderBrush" Value="#E0E4E5" /&gt;
                  &lt;Setter Property="BorderThickness" Value="1.5" /&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
  
          &lt;Setter Property="BorderBrush" Value="#0091EA"/&gt;
          &lt;Setter Property="BorderThickness" Value="1"/&gt;
          &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/&gt;
          &lt;Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/&gt;
          &lt;Setter Property="Padding" Value="1"/&gt;
          &lt;Setter Property="KeyboardNavigation.TabNavigation" Value="None"/&gt;
          &lt;Setter Property="HorizontalContentAlignment" Value="Left"/&gt;
          &lt;Setter Property="FocusVisualStyle" Value="{x:Null}"/&gt;
          &lt;Setter Property="AllowDrop" Value="true"/&gt;
          &lt;Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/&gt;
          &lt;Setter Property="Stylus.IsFlicksEnabled" Value="False"/&gt;
  
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type TextBox}"&gt;
                      &lt;Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                                      Background="{TemplateBinding Background}" SnapsToDevicePixels="True"&gt;
                          &lt;ScrollViewer x:Name="PART_ContentHost"/&gt;
                      &lt;/Border&gt;
                      &lt;ControlTemplate.Triggers&gt;
                          &lt;Trigger Property="IsEnabled" Value="false"&gt;
                              &lt;Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/&gt;
                              &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/&gt;
                          &lt;/Trigger&gt;
                      &lt;/ControlTemplate.Triggers&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  </code></pre>
  
  <p>As you can see guys there is this piece of code (triger) which is saying ok, when you are disabled let your background colour be like this and  borderbrush be like this:</p>
  
  <pre><code>&lt;Style.Triggers&gt;
              &lt;Trigger Property="IsEnabled" Value="False"&gt;
                  &lt;Setter Property="Background" Value="#E0E4E5" /&gt;
                  &lt;Setter Property="BorderBrush" Value="#E0E4E5" /&gt;
                  &lt;Setter Property="BorderThickness" Value="1.5" /&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
  </code></pre>
  
  <p>So here is example of that how does it look :</p>
  
  <p><a href="https://i.stack.imgur.com/1aX3S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1aX3S.png" alt="enter image description here"></a></p>
  
  <p>As it is possible to see  I applied same colours to both of them "#E0E4E5" but obliviously they are different, so guys how could I made it so when my textbox is disables its becoming "#E0E4E5" &lt;- colour..</p>
  
  <p>And I must notice also, if I change colour for border brush it is working. For example I set to both of them textbox and to borderbrush to be red when they are disabled, and I get this:</p>
  
  <p><a href="https://i.stack.imgur.com/EXe4x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EXe4x.png" alt="enter image description here"></a></p>
  
  <p>So border brush changed, but background did not.</p>
  
  <p>Thanks guys,
  Cheers</p>