title: WPF popup gets disappear magically
body: <p>WPF popup is not working as expected for me. So the behavior is show popup when mouse enters on "Test: button and after that Clicking on "Close" button which is on popup will hide the popup. Everything works fine until I left click on "Test" button. After that the Mouse event event gets fired on "Test" button but the popup does not show up.</p>
  
  <p>It would be great if someone will be able to help me out here.</p>
  
  <p>Thanks,
  Code</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication1.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="MainWindow" Height="350" Width="525"&gt;
  &lt;Grid&gt;
  
      &lt;Grid Margin="10"&gt;
          &lt;Button x:Name="btnTest"  Width="100" Height="25" 
                  MouseEnter="btnTest_MouseEnter"&gt;Test Button&lt;/Button&gt;
          &lt;Popup Name="MyPopup"
                 PlacementTarget="{Binding ElementName=btnTest}"
                 Placement="Mouse"
                 StaysOpen="False"&gt;
              &lt;StackPanel Background="PaleGreen"&gt;
                  &lt;Label HorizontalAlignment="Center"&gt;I am a popup&lt;/Label&gt;
                  &lt;Button Click="Hide_Click" Content="Close"/&gt;
              &lt;/StackPanel&gt;
          &lt;/Popup&gt;
      &lt;/Grid&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>Code behind</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Windows;
  using System.Windows.Input;
  namespace WpfApplication1
  {
  /// &lt;summary&gt;
  /// Interaction logic for MainWindow.xaml
  /// &lt;/summary&gt;
  public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
      }
      private void Show_Click(object sender, RoutedEventArgs e)
      {
          MyPopup.IsOpen = true;
      }
      private void Hide_Click(object sender, RoutedEventArgs e)
      {
          MyPopup.IsOpen = false;
      }
      private void btnTest_MouseEnter(object sender, MouseEventArgs e)
      {
          MyPopup.IsOpen = true;
      }
  }
  }
  </code></pre>