title: SelectedItem event fire before LostFocus to update source
body: <p>I have piece of code that binds a Collection to the DataGrid, and the selection of the DataGrid will allows detail edit in the TextBoxes.</p>
  
  <p>So basically DataGrid binds to a Collection, TextBoxes binds to the DataGrid.SelectedItem.(properties).</p>
  
  <p>The problem here is when something editted in the TextBoxes  (say add a character in textbox, without losting focus), then select another item in DataGrid (now lost focus).  The DataGrid will update it SelectedItem property, but now the changes that suppose to make on the previous item is gone, the PropertyChanged event was not fire when the lost focus event happens.</p>
  
  <p>I know I could solve it by using <code>UpdateTriggerSource=PropertyChanged</code>, but there is quite a lot of event firing around if I using <code>PropertyChanged</code>, so I want to see if there is a solution to solve this problem.</p>
  
  <p>And below is my sample code that can reproduce this problem:</p>
  
  <p>Code-Behind:</p>
  
  <pre><code>public partial class MainPage : UserControl
  {
      Person _SelectedPerson { get; set; }
      public Person SelectedPerson
      {
          get
          {
              return this._SelectedPerson;
          }
          set
          {
              if (this._SelectedPerson == value)
                  return;
              this._SelectedPerson = value;
          }
      }
  
      public MainPage()
      {
          InitializeComponent();
  
          Person personA = new Person() { FirstName = "Orange", LastName = "Cake" };
          Person personB = new Person() { FirstName = "Apple", LastName = "Pie" };
          ObservableCollection&lt;Person&gt; aPersonCollection = new ObservableCollection&lt;Person&gt;();
          aPersonCollection.Add(personA);
          aPersonCollection.Add(personB);
  
          MyDataGrid.ItemsSource = aPersonCollection;
          this.DataContext = this;
      }
  }
  
  public class Person : INotifyPropertyChanged
  {
      string _LastName { get; set; }
      public string LastName
      {
          get
          {
              return this._LastName;
          }
          set
          {
              if (this._LastName == value)
                  return;
              this._LastName = value;
              this.OnPropertyChanged("LastName");
          }
      }
  
      string _FirstName { get; set; }
      public string FirstName
      {
          get
          {
              return this._FirstName;
          }
          set {
              if (this._FirstName == value)
                  return;
              this._FirstName = value;
              this.OnPropertyChanged("FirstName");
          }
      }
  
      public event PropertyChangedEventHandler PropertyChanged;
      void OnPropertyChanged(string property)
      { 
          if (PropertyChanged != null)
              this.PropertyChanged(this, new PropertyChangedEventArgs(property));
      }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>&lt;Grid x:Name="LayoutRoot" Background="White"&gt;
      &lt;StackPanel&gt;
          &lt;sdk:DataGrid x:Name="MyDataGrid" SelectedItem="{Binding SelectedPerson, Mode=TwoWay}" /&gt;
          &lt;TextBox Text="{Binding SelectedItem.FirstName, ElementName=MyDataGrid, Mode=TwoWay}" /&gt;
          &lt;TextBox Text="{Binding SelectedItem.LastName, ElementName=MyDataGrid, Mode=TwoWay}" /&gt;
      &lt;/StackPanel&gt;            
  &lt;/Grid&gt;
  </code></pre>