title: using MouseOver in StackPanel WPF
body: <p>I have just started learning <code>WPF</code> and trying to hide a <code>StackPanel</code> during <code>MouseOver</code>. Below is the code that I use. I can only see the <code>Panel</code> flickering when mouse is placed on it but, it doesn't hide completely. Am I missing something here? Thanks in advance.</p>
  
  <pre><code>             &lt;Style x:Key="myStyle" TargetType="{x:Type StackPanel}"&gt;
                  &lt;Style.Triggers&gt;
                      &lt;Trigger Property="IsMouseOver" Value="true"&gt;
                          &lt;Setter Property="Visibility" Value="Hidden" /&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsMouseOver" Value="false"&gt;
                          &lt;Setter Property="Visibility" Value="Visible" /&gt;
                      &lt;/Trigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;  
  </code></pre>
  
  <p>Stackpanel:</p>
  
  <pre><code>&lt;StackPanel Style="{StaticResource myStyle}"&gt;
  
  // Child controls
  
  &lt;/StackPanel&gt;
  </code></pre>