title: WPF - MVVM - ComboBox SelectedItem
body: <p>I have <code>ViewModel</code>(implemented <code>INotifyPropertyChanged</code>) in the background and class <code>Category</code> which has only one property of type <code>string</code>. My ComboBox SelectedItem is bind to an instance of a Category. When i change the value of instance, SelectedItem is not being updated and Combobox is not changed.</p>
  
  <p>EDIT: code</p>
  
  <p>Combobox:</p>
  
  <pre><code>&lt;ComboBox x:Name="categoryComboBox" Grid.Column="1"  Grid.Row="3" Grid.ColumnSpan="2" 
            Margin="10" ItemsSource="{Binding Categories}"
            DisplayMemberPath="Name" SelectedValue="{Binding NodeCategory, Mode=TwoWay}"/&gt;
  </code></pre>
  
  <p>Property:</p>
  
  <pre><code>private Category _NodeCategory;
  public Category NodeCategory
  {
      get
      {
          return _NodeCategory;
      }
      set
      {
          _NodeCategory = value;
          OnPropertyChanged("NodeCategory");
      }
  }
  
  [Serializable]
  public class Category : INotifyPropertyChanged
  {
      private string _Name;
      [XmlAttribute("Name")]
      public string Name
      {
          get
          {
              return _Name;
          }
          set
          {
              _Name = value;
              OnPropertyChanged("Name");
          }
      }
  
      public void OnPropertyChanged(string propertyName)
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
          }
      }
  
      [field:NonSerialized]
      public event PropertyChangedEventHandler PropertyChanged;
  }
  </code></pre>
  
  <p>and what I am trying is: when I set</p>
  
  <pre><code>NodeCategory = some_list_of_other_objects.Category;
  </code></pre>
  
  <p>to have that item selected in <code>Combobox</code> with appropriate <code>DisplayMemberPath</code></p>