title: Validation adorner does not completely disappear in Animation
body: <p>I have a WPF Window that contains a <code>ContentPresenter</code> that has Height and Width set to 0 by default.
  When a user clicks a button, I run an animation to transform the ContentPresenter's Height and Width properties to 896,1024 (actually it does 3 rotations whilst its growing, too) and this is all good...</p>
  
  <p>The DataContext for the User control implements IDataErrorInfo and if the user does not click the 'I have read and understand these Health &amp; Safety instructions" checkbox, then a red border is shown around the checkbox...</p>
  
  <p>My problem is that if the user clicks 'Cancel', and I run the animation that shrinks the Height &amp; Width back down to 0,0, then the UserControl shrinks as required, but the red border does not completely disappear - it leaves a single red pixel in the middle of my Window</p>
  
  <p>Anybody any ideas what I'm doing wrong? The 'red-border', I'm assuming is just an Adorner being rendered by WPF for me, so I'm not sure how to change this behaviour...</p>
  
  <p>All help much appreciated!</p>
  
  <p><strong>Update</strong> - I tried Abe's excellent suggestion, but unfortunately it didn't work, but it did get me trying other stuff... So now I have (temporarily) commented out the 'shrinking' animations, and simply set the visibility to Collapsed at KeyTime="0:0:0.9"... when I press cancel, just less than a second later, the UserControl disappears but the red adorner stubbornly remains :(</p>
  
  <p>As an extra bit of info (not sure if relevant?) the UserControl being shown in the ContentPresenter also contains a ContentPresenter to render a UserControl, and its the inner content that contains the validation adorner...</p>
  
  <p>code sample:</p>
  
  <pre><code>&lt;Button
      Name="signInButton"
      Grid.Row="0" Grid.Column="0"
      Margin="30"
      HorizontalAlignment="Right" VerticalAlignment="Bottom"
      Style="{StaticResource LargeButtonStyle}" 
      Content="Sign In"
      Command="{Binding SignInCommand}"&gt;
      &lt;Button.Triggers&gt;
          &lt;EventTrigger
              RoutedEvent="Button.Click"&gt;
              &lt;BeginStoryboard
                  Storyboard="{DynamicResource openViewAnimation}" /&gt;
          &lt;/EventTrigger&gt;
      &lt;/Button.Triggers&gt;
  &lt;/Button&gt;
  
  &lt;ContentPresenter
      Name="mainView"
      Grid.RowSpan="2" Grid.ColumnSpan="2"
      HorizontalAlignment="Center" VerticalAlignment="Center"
      Opacity="0.9"
      Content="{Binding CurrentContent}"&gt;
      &lt;ContentPresenter.RenderTransform&gt;
          &lt;RotateTransform
              Angle="0" /&gt;
      &lt;/ContentPresenter.RenderTransform&gt;
  &lt;/ContentPresenter&gt;
  </code></pre>
  
  <p>
      
          
          
          
          
          
      </p>
  
  <pre><code>&lt;Storyboard x:Key="closeViewAnimation"&gt;
      &lt;DoubleAnimation
          Storyboard.TargetName="mainView" Storyboard.TargetProperty="Height"
          From="896" To="0" Duration="0:0:0.9"
          AutoReverse="False" RepeatBehavior="1x" /&gt;
      &lt;DoubleAnimation
          Storyboard.TargetName="mainView" Storyboard.TargetProperty="Width"
          From="1024" To="0" Duration="0:0:0.9"
          AutoReverse="False" RepeatBehavior="1x" /&gt;
  &lt;/Storyboard&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks, Ian</p>