title: WPF Combobox object selection
body: <p>I have two classes:</p>
  
  <pre><code>  class Customer
    {
          public int CustomerId { get; set; }
          public string Name { get; set; }
          public PriceGroup priceGroup {get; set}
    }
  
    class PriceGroup
    {
          public int PriceGroupId {get; set;}
          public string Name {get; set;}
          public override string ToString() {return name;}
    }
  </code></pre>
  
  <p>I have also a dataset of PriceGroup objects:</p>
  
  <pre><code>DataSet&lt;PriceGroup&gt; priceGroups;
  </code></pre>
  
  <p>It contains few elements.</p>
  
  <p>I need to have the ability to select PriceGroup in Combobox and set it up in Customer.priceGroup member.</p>
  
  <p>At the moment I'm able to display priceGroups items in Combobox without any problem with following code: </p>
  
  <pre><code>Combobox.ItemsSource = priceGroups;
  </code></pre>
  
  <p>But I have no idea how to handle selection.
  I tried this, but it doesn't work.</p>
  
  <pre><code>  &lt;ComboBox Name="ComboBoxPriceGroup" 
              Text="{Binding priceGroup}"
              DisplayMemberPath="Name"
              SelectedValuePath="PriceGroup"
              SelectedValue="{Binding priceGroup}"/&gt;
  </code></pre>
  
  <p>Do you have any idea how should I set up ComboBox properties, so it would update Customer.priceGroup member when Combobox selection changes?</p>