title: wpf popup not showing on button click
body: <p>I have a button and a popup control in it in my xaml as follows:</p>
  
  <pre><code>&lt;Button Grid.Column="0" Grid.Row="5" 
          HorizontalAlignment="Center" 
          Margin="88,8,214,0"  
          Grid.RowSpan="2" Height="26" 
          VerticalAlignment="Top" Width="22"
          IsEnabled="{Binding Path=SearchFound}" 
          x:Name="cmdPlanList" 
          Click="cmdPlanList_Click"&gt;
      &lt;ContentControl&gt;
          &lt;Popup IsOpen = "{Binding PlanPopup}"
                 PlacementTarget = "{Binding ElementName = cmdPlanList}"
                 AllowsTransparency = "True" 
                 PopupAnimation = "Slide" 
                 x:Name="Popup4Plan"&gt;
              &lt;Canvas Width = "125" 
                      Height = "100" 
                      Background = "Red" &gt;
                  &lt;Canvas.RenderTransform&gt;
                      &lt;RotateTransform x:Name = "theTransform" /&gt;
                  &lt;/Canvas.RenderTransform&gt;
                  &lt;TextBlock TextWrapping = "Wrap" 
                             Foreground = "Blue"  
                             Text = "Hi, this is Popup" /&gt;
              &lt;/Canvas&gt;
          &lt;/Popup&gt;
      &lt;/ContentControl&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>I am setting the DataContext of this Popup from my code-behind as follows:-</p>
  
  <p>My View's code behind:-</p>
  
  <pre><code>using xyz
  { 
      private bool _PlanPopup = false;
      public bool PlanPopup
      {
          get { return _PlanPopup; }
          set
          {
              _PlanPopup = value;
          }
      }
      public MyView()
      {
          InitializeComponent();
          Popup4Plan.DataContext = this;
      }
      private void cmdPlanList_Click(object sender, RoutedEventArgs e)
      {
          this.PlanPopup = this.PlanPopup ? false : true;
      }
  }
  </code></pre>