title: WPF stackpanel visibility animation
body: <p>I have a stackpanel with a button which, when clicked, makes the stackpanel disappear. I want to animate the transition form visible to hidden, but haven't been able to.</p>
  
  <p>I looked around for a while and bumped into something that looks like this:</p>
  
  <pre><code>&lt;StackPanel Margin="80,60,60,80" Background="Gray"&gt;
      &lt;StackPanel.Triggers &gt;
  
          &lt;EventTrigger  &gt; 
              &lt;EventTrigger.Actions&gt;
                  &lt;BeginStoryboard&gt;
                      &lt;Storyboard TargetProperty="Visibility"&gt;
  
                          &lt;DoubleAnimation Duration="0:0:5:0" From="Visible" To="Hidden"/&gt;
  
                      &lt;/Storyboard&gt;
                  &lt;/BeginStoryboard&gt;
              &lt;/EventTrigger.Actions&gt;
          &lt;/EventTrigger&gt;
  
      &lt;/StackPanel.Triggers&gt;
      &lt;Button Name="buttonTop" Content="TOP" Margin="40,40,40,40" Click="buttonTop_Click" Width="131" /&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>which of course, is not 100% there yet. Any ideas? </p>