title: WPF popup closing before treeview selection
body: <p>I'm working on a project with a treeview inside a popup.  I need to have it where the popup remains open until a selection is made on the treeview.  At first I tried controlling this with selectedItemChanged on the treeview, then MouseLeave, but if you overshoot the popup by just a pixel, it closes without you being able to make a selection on the treeview.</p>
  
  <p>I'm looking to do something such as"</p>
  
  <pre><code>if (dirTree.SelectedItem = "")
       { 
         popup1.IsOpen = true; 
       }
         popup1.IsOpen = false;
  </code></pre>
  
  <p>but that gives me "Possible unintended reference comparison; to get a value comparison, cas t the left hand side to type 'string'."</p>
  
  <p>I've been searching using "treeview any selected" "treeview SelectedItem", etc.  Admittedly it may just be a simple syntax issue because I'm new to C# and WPF.</p>