title: ComboBox twoway binding with XElement
body: <p>I want to bind a ComboBox to a XElement from a XDocument. The twoway-Binding works on a Textbox but not on the ComboBox:</p>
  
  <p>xaml:</p>
  
  <pre><code>&lt;Window x:Class="ComboBoxBindingTest.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Grid&gt;
          &lt;ComboBox Height="23" HorizontalAlignment="Left" Margin="31,38,0,0" Name="comboBox1" VerticalAlignment="Top" Width="120" SelectedValue="{Binding Path=Element[step].Element[schema].Value}" /&gt;
          &lt;TextBox Height="23" HorizontalAlignment="Left" Margin="31,117,0,0" Name="textBox1" VerticalAlignment="Top" Width="120" Text="{Binding Path=Element[step].Element[schema].Value}"/&gt;
          &lt;TextBox Height="23" HorizontalAlignment="Left" Margin="31,214,0,0" Name="textBox2" VerticalAlignment="Top" Width="120" /&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>cs:</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
  
          comboBox1.Items.Add(new Tuple&lt;string, string&gt;("1", "Wert 1"));
          comboBox1.Items.Add(new Tuple&lt;string, string&gt;("2", "Wert 2"));
          comboBox1.Items.Add(new Tuple&lt;string, string&gt;("3", "Wert 3"));
          comboBox1.Items.Add(new Tuple&lt;string, string&gt;("4", "Wert 4"));
          comboBox1.Items.Add(new Tuple&lt;string, string&gt;("5", "Wert 5"));
          comboBox1.Items.Add(new Tuple&lt;string, string&gt;("6", "Wert 6"));
          comboBox1.Items.Add(new Tuple&lt;string, string&gt;("7", "Wert 7"));
  
          comboBox1.SelectedValuePath = "Item1";
          comboBox1.DisplayMemberPath = "Item2";
  
          XDocument doc = XDocument.Parse("&lt;dir&gt;&lt;step&gt;&lt;schema&gt;2&lt;/schema&gt;&lt;/step&gt;&lt;/dir&gt;");
          DataContext = doc.Element("dir");
      }
  }
  </code></pre>
  
  <p>Changing the text in the textbox to another number from 1 to 7 results in an update of the comboBox, but not vice versa. The Value in the XML is not changed when the comboBox selection is changed. </p>
  
  <p>What is wrong in the ComboBox Binding?</p>
  
  <p>Thanks</p>