title: Type list of selected items in a wpf datagrid
body: <p>I send the selected items to a specific command when the selection changes (each item is a class X)</p>
  
  <p>I get them as object how can I convert it to a list?</p>
  
  <p>I tried:</p>
  
  <pre><code>1. IList&lt;x&gt;  SelectedItemsList = obj as ObservableCollection&lt;x&gt;;
  
  2. IList&lt;x&gt;  SelectedItemsList = obj as IList&lt;x&gt;;
  
  3. List&lt;x&gt;  SelectedItemsList = obj as List&lt;x&gt;;
  </code></pre>
  
  <p>It did not help.</p>
  
  <p>This type of list: <code>System.Windows.Controls.SelectedItemCollection</code> I want to convert it to my list: <code>ObservableCollection&lt;x&gt;/IList&lt;x&gt;/List&lt;x&gt;</code> (the ViewModel not recognized a list of controls of wpf)</p>