title: Opening a WPF popup on button click
body: <p>I have a WPF button and I am trying to show a WPF popup over it, or at its top, when button is clicked:</p>
  
  <pre><code>&lt;StackPanel Grid.Column="3"&gt;
      &lt;Button x:Name="btnPrint"
          FocusVisualStyle="{x:Null}" 
          Style="{DynamicResource MyButtonStyle}"  
          Margin="15 5 5 5" Height="29"
          IsEnabled="{Binding BtnPrintEnabled}" 
          Command="{Binding btnPrintCommand}" 
          IsTabStop="False"&gt;
          Print
      &lt;/Button&gt;
      &lt;Popup IsOpen="{Binding IsPrintPopupOpen}" StaysOpen="False"  &gt;
          &lt;Border Background="LightYellow"&gt;
              &lt;TextBlock&gt;Sending to print ...&lt;/TextBlock&gt;
          &lt;/Border&gt;
      &lt;/Popup&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>Popup is bound to a property in view model so when button is clicked, button command is executed. Command executes below method in view model:</p>
  
  <pre><code>private void ImprimirRemesa()
  {
     IsPrintPopupOpen = true;
  
     // Do some things
  
     IsPrintPopupOpen = false;
  }
  
  private bool _isPrintPopupOpen = false;
  public bool IsPrintPopupOpen
  {
      get
      {
          return _isPrintPopupOpen;
      }
  
      set
      {
          if (_isPrintPopupOpen = value) return;
  
          _isPrintPopupOpen = value;
          OnPropertyChanged("IsPrintPopupOpen");
      }
  }
  </code></pre>
  
  <p>but it does not work. Nothing happens.</p>