title: How do I sort an observable collection?
body: <p>I have a following class :</p>
  
  <pre><code>[DataContract]
  public class Pair&lt;TKey, TValue&gt; : INotifyPropertyChanged, IDisposable
  {
      public Pair(TKey key, TValue value)
      {
          Key = key;
          Value = value;
      }
  
      #region Properties
      [DataMember]
      public TKey Key
      {
          get
          { return m_key; }
          set
          {
              m_key = value;
              OnPropertyChanged("Key");
          }
      }
      [DataMember]
      public TValue Value
      {
          get { return m_value; }
          set
          {
              m_value = value;
              OnPropertyChanged("Value");
          }
      }
      #endregion
  
      #region Fields
      private TKey m_key;
      private TValue m_value;
      #endregion
  
      #region INotifyPropertyChanged Members
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      protected void OnPropertyChanged(string name)
      {
          PropertyChangedEventHandler handler = PropertyChanged;
          if (handler != null)
          {
              handler(this, new PropertyChangedEventArgs(name));
          }
      }
  
      #endregion
  
      #region IDisposable Members
  
      public void Dispose()
      { }
  
      #endregion
  }
  </code></pre>
  
  <p>Which I've put in an ObservableCollection :</p>
  
  <pre><code>ObservableCollection&lt;Pair&lt;ushort, string&gt;&gt; my_collection = 
      new ObservableCollection&lt;Pair&lt;ushort, string&gt;&gt;();
  
  my_collection.Add(new Pair(7, "aaa"));
  my_collection.Add(new Pair(3, "xey"));
  my_collection.Add(new Pair(6, "fty"));
  </code></pre>
  
  <p>Q : How do I sort it by key ?</p>