title: Can I somehow animate foreground color of textblock if foreground is binded to a property?
body: <p>If I put Foreground=&quot;White&quot; in XAML then the foreground animates ok.
  But when I put Foreground=&quot;{Binding NumberForeground}&quot; then I get: Cannot animate '(0).(1)' on an immutable object instance.</p>
  <p>Here is the code:</p>
  <pre class="lang-xml prettyprint-override"><code> &lt;TextBlock Text=&quot;{Binding NumberText}&quot; Foreground=&quot;{Binding NumberForeground}&quot; Visibility=&quot;{Binding NumberVisibility}&quot;&gt;
      &lt;TextBlock.Style&gt;
          &lt;Style TargetType=&quot;TextBlock&quot; BasedOn=&quot;{StaticResource NumberTextBlockStyle}&quot;&gt;
              &lt;Style.Triggers&gt;
                  &lt;MultiDataTrigger&gt;
                      &lt;MultiDataTrigger.Conditions&gt;
                          &lt;Condition Binding=&quot;{Binding EndGame}&quot; Value=&quot;True&quot;/&gt;
                          &lt;Condition Binding=&quot;{Binding NumberSelected}&quot; Value=&quot;True&quot;/&gt;
                      &lt;/MultiDataTrigger.Conditions&gt;
                      &lt;MultiDataTrigger.EnterActions&gt;
                          &lt;BeginStoryboard x:Name=&quot;animateNumberTextStoryboard&quot; Storyboard=&quot;{StaticResource animateNumberText}&quot; /&gt;
                      &lt;/MultiDataTrigger.EnterActions&gt;
                  &lt;/MultiDataTrigger&gt;
                  &lt;DataTrigger Binding=&quot;{Binding EndGame}&quot; Value=&quot;False&quot;&gt;
                      &lt;DataTrigger.EnterActions&gt;
                          &lt;StopStoryboard BeginStoryboardName=&quot;animateNumberTextStoryboard&quot;/&gt;
                      &lt;/DataTrigger.EnterActions&gt;
                  &lt;/DataTrigger&gt;
                  &lt;DataTrigger Binding=&quot;{Binding NumberSelected}&quot; Value=&quot;False&quot;&gt;
                      &lt;DataTrigger.EnterActions&gt;
                          &lt;StopStoryboard BeginStoryboardName=&quot;animateNumberTextStoryboard&quot;/&gt;
                      &lt;/DataTrigger.EnterActions&gt;
                  &lt;/DataTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/TextBlock.Style&gt;
  &lt;/TextBlock&gt;
  </code></pre>
  <p>And the animation looks like this:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Storyboard x:Key=&quot;animateNumberText&quot;&gt;
      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(TextBox.Foreground).(SolidColorBrush.Color)&quot; 
                                    Duration=&quot;0:0:0.45&quot; RepeatBehavior=&quot;Forever&quot;&gt;
          &lt;LinearColorKeyFrame Value=&quot;#FFFFCA00&quot; KeyTime=&quot;0:0:0.15&quot; /&gt;
          &lt;LinearColorKeyFrame Value=&quot;#FFFF2500&quot; KeyTime=&quot;0:0:0.3&quot; /&gt;
          &lt;LinearColorKeyFrame Value=&quot;#FFCEC100&quot; KeyTime=&quot;0:0:0.45&quot; /&gt;
      &lt;/ColorAnimationUsingKeyFrames&gt;
  &lt;/Storyboard&gt;
  </code></pre>