title: MVVM: Binding to ListBox.SelectedItem isn't being updated?
body: <p>How do I bind a view model property to the ListBox.SelectedItem property?</p>
  
  <p>I have created a simple MVVM demo to try to figure this one out. My view model has these properties:</p>
  
  <pre><code>private ObservableCollection&lt;DisneyCharacter&gt; p_DisneyCharacters;
  public ObservableCollection&lt;DisneyCharacter&gt; DisneyCharacters
  {
      get { return p_DisneyCharacters; }
  
      set
      {
          p_DisneyCharacters = value;
          base.FirePropertyChangedEvent("DisneyCharacters");
      }
  }
  
  private DisneyCharacter p_SelectedItem;
  public DisneyCharacter SelectedItem
  {
      get { return p_SelectedItem; }
  
      set
      {
          p_SelectedItem = value;
          base.FirePropertyChangedEvent("SelectedItem");
      }
  }
  </code></pre>
  
  <p>I want to bind the SelectedItem property to the item selected in the list box. Here is the XAML for the list box:</p>
  
  <pre><code>&lt;ListBox ItemTemplate="{StaticResource MasterTemplate}"
           ItemsSource="{Binding Path=DisneyCharacters}" 
           SelectedItem="{Binding Path=Selectedtem, Mode=TwoWay}" 
           HorizontalAlignment="Stretch" /&gt;
  </code></pre>
  
  <p>Here is my problem: The view model SelectedItem property isn't being updated when I change the selection in the list box.</p>
  
  <p>I did a test where I temporarily replaced the view model SelectedItem property with a SelectedIndex property, and I bound that to the ListBox.SelectedIndex property. That property updated fine--it's just the SelectedItem property that I can't get to work.</p>
  
  <p>So, how do I fix the SelectedItem binding? Thanks for your help.</p>