title: Implementing a custom sort for WinForms ListView
body: <p>I have a class called <code>Picture</code> and that has a name and <code>size</code> (<code>int</code>) property.</p>
  
  <p>I was going to sort them using size, but not the displayed file name which is the item name in the <code>listview</code>.</p>
  
  <p>I implemented <code>IComparer&lt;Picture&gt;</code> for the <code>Picture</code> type, and then when I write this:</p>
  
  <pre><code>this.PicList.ListViewItemSorter = AllPictures[0];
  </code></pre>
  
  <p>or</p>
  
  <pre><code>this.PicList.ListViewItemSorter = Picture;
  </code></pre>
  
  <p>they don't compile.</p>
  
  <p>How do I do this? On MSDN it shows a separate class for the sorter but can I do it built-in with the used type <code>Picture</code>?</p>