title: WPF DataGrid not showing selected items when I open a second window
body: <p>I open a borderless window with ShowDialog() on mouse right click over WPF datagrid. The aim is to give user chance to add selected items to a list. When the dialog window opens the selected items in DataGrid loose the selected "visuals" (in this case the default blue highlight) until the dialog is closed. How do I get around this so user still has a visual clue as to what they have selected.</p>
  
  <p>Code to open dialog = </p>
  
  <pre><code>private void MusicLibrary_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
      {
          Point mousePoint = this.PointToScreen(Mouse.GetPosition(this));
          PlayListRClick option = new PlayListRClick();
          option.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual;
          option.Height = 150;
          option.Width = 100;
          option.Left = mousePoint.X;
          option.Top = mousePoint.Y;
          option.ShowDialog();
  
  
          //Get the selected option and add itmes to playlist as needed
          switch (option.choice)
          {
              case RightClickChoice.AddToPlayList:
                  IList Items = MusicLibrary.SelectedItems;
                  List&lt;MyAlbum&gt; albums = Items.Cast&lt;MyAlbum&gt;().ToList();
                  foreach (MyAlbum a in albums)
                  {
                      PlayListOb.Add(a);
  
                  }
                  break;
  
  
          }
  
  
      }
  </code></pre>