title: Having an issue with my TextBox control template
body: <p>I am working on a simple textBox template, which is just two borders, one with a gradient background.  Now, my specific issue is that I want to be able to set the foreground color of the textBox to whatever color I want and have it work correctly.  However, I can't seem to get both the disabled foreground and enabled foreground colors to work together.  If I set the foreground to red for example, when I disable the textBox, the foreground doesn't get changed to my disabled color.  I tried binding the foreground in the IsEnabled="true" trigger but that doesn't seem to work.  The foreground always stays red, no matter if the textBox is enabled or not.</p>
  
  <p>Can you please take a look at the below template and tell me what I am doing wrong?  Also, please point out to me any other mistakes I may have made since I am new at creating templates.</p>
  
  <p>Thanks a lot.</p>
  
  <pre><code>  &lt;SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" /&gt;
    &lt;SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" /&gt;
    &lt;SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" /&gt;
    &lt;SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#DDD" /&gt;
  
  
  &lt;Style x:Key="TextBoxControlTemplate1" TargetType="{x:Type TextBox}"&gt;
    &lt;Setter Property="KeyboardNavigation.TabNavigation" Value="None"/&gt;
    &lt;Setter Property="AllowDrop" Value="true"/&gt;
    &lt;Setter Property="Background" Value="#00000000"/&gt;
    &lt;Setter Property="HorizontalContentAlignment" Value="Stretch"/&gt;
    &lt;Setter Property="VerticalContentAlignment" Value="Stretch"/&gt;
    &lt;Setter Property="FontFamily" Value="Segoe UI"/&gt;
    &lt;Setter Property="FontSize" Value="12"/&gt;
    &lt;Setter Property="Padding" Value="8,5,3,3"/&gt;
    &lt;Setter Property="BorderThickness" Value="0"/&gt;
    &lt;Setter Property="Template"&gt;
      &lt;Setter.Value&gt;
        &lt;ControlTemplate TargetType="{x:Type TextBox}"&gt;
          &lt;Grid&gt;
            &lt;Border BorderBrush="#FF000000" BorderThickness="2,2,2,2" CornerRadius="5,5,5,5" Padding="0,0,0,0" Width="Auto" Height="Auto" Background="#FF000000"/&gt;
            &lt;Border x:Name="Border" BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="5,5,5,5" Padding="0,0,0,0" Width="Auto" Height="Auto" Margin="2,2,2,2"&gt;
              &lt;Border.Background&gt;
                &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                  &lt;GradientStop Color="#FF000000" Offset="0"/&gt;
                  &lt;GradientStop Color="#FF4D4D4D" Offset="1"/&gt;
                &lt;/LinearGradientBrush&gt;
              &lt;/Border.Background&gt;
            &lt;/Border&gt;
            &lt;ScrollViewer Margin="0" x:Name="PART_ContentHost"/&gt;
          &lt;/Grid&gt;
          &lt;ControlTemplate.Triggers&gt;
            &lt;Trigger Property="IsEnabled" Value="False"&gt;
              &lt;Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/&gt;
              &lt;Setter Property="BorderBrush" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/&gt;
              &lt;Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/&gt;
            &lt;/Trigger&gt;
            &lt;Trigger Property="IsEnabled" Value="True"&gt;
              &lt;Setter Property="Foreground" Value="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type TextBox}}}"/&gt;
            &lt;/Trigger&gt;
          &lt;/ControlTemplate.Triggers&gt;
        &lt;/ControlTemplate&gt;
      &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
  &lt;/Style&gt;
  
  
  &lt;TextBox Text="TEST" TextWrapping="Wrap" Canvas.Top="293.761" Canvas.Left="112" Style="{DynamicResource TextBoxControlTemplate1}" Height="28.724" Width="232.25" IsTabStop="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" IsEnabled="True" Foreground="#FFFF0000"/&gt;
  </code></pre>