title: WPF DisplayMemberPath not Updating when SelectedItem is removed
body: <p>I have simplified this problem down as much as I can. Basically I am overriding the "null" value of a combobox. So that if the item selected is deleted, it reverts back to "(null)". Unfortunately the behaviour of this is wrong, I hit delete, the ObservableCollection item is removed, thus the property binding is updated and it returns the "(null)" item as expected. But the combobox appearance shows blank. Yet the value its bound to is correct... this problem can be reproduced with the code below.</p>
  
  <p>To reproduce this problem you select an item, and hit remove. Notice at this point the following line is called (when you remove the selected item). So its a good place to breakpoint.</p>
  
  <pre><code>                if (m_Selected == null)
              {
                  return Items[0]; //items 0 is ItemNull
              }
  </code></pre>
  
  <p>Also notice that I have attmpted to fix it by Forcing a property update on the DisplayMemberPath. This did not work.</p>
  
  <p>MainWindow.xaml</p>
  
  <pre><code>&lt;Window x:Class="WPFCodeDump.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;StackPanel&gt;
          &lt;ComboBox ItemsSource="{Binding Items}" SelectedItem="{Binding Selected, Mode=TwoWay}" DisplayMemberPath="Name"&gt;&lt;/ComboBox&gt;
          &lt;Button  Click="ButtonBase_OnClick"&gt;Remove Selected&lt;/Button&gt;
      &lt;/StackPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>MainWindowViewModel.cs</p>
  
  <pre><code>using System.Collections.ObjectModel;
  using System.ComponentModel;
  using System.Runtime.CompilerServices;
  using System.Windows.Input;
  
  namespace WPFCodeDump
  {
      public abstract class ViewModelBase : INotifyPropertyChanged
      {
          public event PropertyChangedEventHandler PropertyChanged;
  
          protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = "")
          {
              PropertyChangedEventHandler handler = PropertyChanged;
              if (handler != null)
              {
                  handler(this, new PropertyChangedEventArgs(propertyName));
              }
          }
      }
  
      //Item class
      public class Item : ViewModelBase
      {
          public Item(string name)
          {
              m_Name = name;
          }
  
          public string Name
          {
              get { return m_Name; }
          }
          private string m_Name;
  
          public void ForcePropertyUpdate()
          {
              OnPropertyChanged("Name");
          }
      }
  
      //Item class
      public class ItemNull : Item
      {
          public ItemNull()
              : base("(null)")
          {
          }
      }
  
      class MainWindowViewModel : ViewModelBase
      {
          public MainWindowViewModel()
          {
              m_Items.Add(new ItemNull());
              for (int i = 0; i &lt; 10; i++)
              {
                  m_Items.Add(new Item("TestItem" + i));
              }
              Selected = null;
          }
  
          //Remove selected command
          public void RemoveSelected()
          {
              Items.Remove(Selected);
          }
  
          //The item list
          private ObservableCollection&lt;Item&gt; m_Items = new ObservableCollection&lt;Item&gt;();
          public ObservableCollection&lt;Item&gt; Items
          {
              get { return m_Items; }
          }
  
          //Selected item
          private Item m_Selected;
          public Item Selected
          {
              get
              {
                  if (m_Selected == null)
                  {
                      return Items[0]; //items 0 is ItemNull
                  }
                  return m_Selected;
              }
              set
              {
                  m_Selected = value;
                  OnPropertyChanged();
                  if(m_Selected!=null) m_Selected.ForcePropertyUpdate();
              }
          }
      }
  }
  </code></pre>
  
  <p>MainWindow.xaml.cs</p>
  
  <pre><code>using System.Windows;
  
  namespace WPFCodeDump
  {
  
  
      /// &lt;summary&gt;
      /// Interaction logic for MainWindow.xaml
      /// &lt;/summary&gt;
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
              DataContext = new MainWindowViewModel();
          }
  
          private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
          {
              ((MainWindowViewModel) DataContext).RemoveSelected();
          }
      }
  }
  </code></pre>
  
  <p>Result:</p>
  
  <p><img src="https://i.stack.imgur.com/NSCeK.png" alt="Result after pressing remove"></p>