title: ColorAnimationUsingKeyFrames changes brush
body: <p>Well hi, I am kind of new to WPF and this is the first time I tried change styles of WPF controls. Thanks to Expression Blend everything went better than expected until I made this style.</p>
  
  <pre><code> &lt;Style TargetType="{x:Type TextBox}"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type TextBox}"&gt;
                  &lt;Grid&gt;
                      &lt;VisualStateManager.VisualStateGroups&gt;
                          &lt;VisualStateGroup x:Name="CommonStates"&gt;
                              &lt;VisualState x:Name="Normal"/&gt;
                              &lt;VisualState x:Name="Disabled"&gt;
                                  &lt;Storyboard&gt;
                                      &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_ContentHost"&gt;
                                          &lt;EasingDoubleKeyFrame KeyTime="0" Value="0.5"/&gt;
                                      &lt;/DoubleAnimationUsingKeyFrames&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="Background"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0" Value="Red"/&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="Background"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0" Value="Yellow"/&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                  &lt;/Storyboard&gt;
                              &lt;/VisualState&gt;
                              &lt;VisualState x:Name="ReadOnly"/&gt;
                              &lt;VisualState x:Name="MouseOver"/&gt;
                          &lt;/VisualStateGroup&gt;
                      &lt;/VisualStateManager.VisualStateGroups&gt;
                      &lt;Rectangle x:Name="Background" Fill="{StaticResource ControlBackgroundBrush}" Stroke="{StaticResource NormalBrush}" RadiusX="2" RadiusY="2"/&gt;
                      &lt;ScrollViewer x:Name="PART_ContentHost" Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" FontFamily="{TemplateBinding FontFamily}"/&gt;
                  &lt;/Grid&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
      &lt;Setter Property="Foreground" Value="Black"/&gt;
      &lt;Setter Property="SnapsToDevicePixels" Value="True"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Those two brushes are here:</p>
  
  <pre><code>    &lt;Color x:Key="MainColor"&gt;#FF595959&lt;/Color&gt;
  &lt;Color x:Key="ControlBackgroundColor"&gt;#FF333333&lt;/Color&gt;
  
  &lt;SolidColorBrush x:Key="NormalBrush" Color="{DynamicResource MainColor}"/&gt;
  &lt;SolidColorBrush x:Key="ControlBackgroundBrush" Color="{StaticResource ControlBackgroundColor}" /&gt;
  </code></pre>
  
  <p>Well and what is the problem. Disabling TextBox should change BorderColor and Background of TextBox but it also changes color of everything what uses <code>NormalBrush</code>. I want to have just few brushes common for all controls to let the theme be easily modified. One more thing I use them Usualy in other styles as StaticResource. Your suggestions and help would be highly appreciated.</p>