title: Xaml - VisualStates - changing background between color and animation
body: <p>I have custom control which looks like this:</p>
  
  <pre><code>&lt;Style TargetType="local:AnswerButton"&gt;
  &lt;Setter Property="Background" Value="{StaticResource BlueGradient}"/&gt;
  &lt;Setter Property="Template"&gt;
  &lt;Setter.Value&gt;
  &lt;ControlTemplate TargetType="local:AnswerButton"&gt;
  &lt;Grid&gt;
  &lt;vsm:VisualStateManager.VisualStateGroups&gt;
     &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
        &lt;vsm:VisualState x:Name="Normal"&gt;
          &lt;Storyboard&gt;
             &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background)" Storyboard.TargetName="myBorder"&gt;
               &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BlueGradient}" /&gt;
             &lt;/ObjectAnimationUsingKeyFrames&gt;
          &lt;/Storyboard&gt;
        &lt;/vsm:VisualState&gt;
        &lt;vsm:VisualState x:Name="RightAnswer"&gt;
           &lt;Storyboard RepeatBehavior="Forever" BeginTime="00:00:00" AutoReverse="True"&gt;
              &lt;ColorAnimation Duration="0:0:0.6" From="Orange" To="Green" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="myBorder"/&gt;
           &lt;/Storyboard&gt;
        &lt;/vsm:VisualState&gt;
      &lt;/vsm:VisualStateGroup&gt;
    &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
    &lt;Border BorderBrush="Blue" BorderThickness="2" CornerRadius="10"&gt;
      &lt;Border Name="myBorder" Background="{TemplateBinding Background}" CornerRadius="9" Opacity="1"&gt;
         &lt;Grid&gt;
           &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="100"/&gt;
              &lt;ColumnDefinition Width="*" /&gt;
           &lt;/Grid.ColumnDefinitions&gt;
           &lt;TextBlock Grid.Column="0"
                      TextAlignment="Center" VerticalAlignment="Center" 
                      Text="{TemplateBinding Option}" Foreground="Yellow" /&gt;
           &lt;TextBlock Grid.Column="1"
                      TextAlignment="Left" VerticalAlignment="Center" 
                      Text="{TemplateBinding Text}" Foreground="White" /&gt;
          &lt;/Grid&gt;
        &lt;/Border&gt;
      &lt;/Border&gt;
    &lt;/Grid&gt;
    &lt;/ControlTemplate&gt;
    &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
    &lt;/Style&gt;
  </code></pre>
  
  <p>I just want to change states of button. First (default) which button has that BlueGradient brush and second where there is animation (like in RightAnswer state). This code is partly working. When I set RightAnswer state to button then I change it to Normal and then when I tried set it to RightAnswer I get this error:</p>
  
  <blockquote>
    <p>Cannot resolve TargetProperty
    (Border.Background).(SolidColorBrush.Color) on specified object.</p>
  </blockquote>
  
  <p>I think the problem is that in one state I got <code>Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"</code> and in second <code>Storyboard.TargetProperty="(Border.Background)"</code>. I tried to change that but it's not working. So how can I fix this?</p>
  
  <p>Edit:</p>
  
  <p>BlueGradient</p>
  
  <pre><code>&lt;LinearGradientBrush x:Key="BlueGradient"  
      StartPoint="0,0" EndPoint="1,1"&gt;
          &lt;GradientStop Color="#12449d" Offset="0" /&gt;
          &lt;GradientStop Color="#0a2554" Offset="1" /&gt;
      &lt;/LinearGradientBrush&gt;
  </code></pre>