title: “UpdateSourceTrigger=PropertyChanged” equivalent for a TextBox in WinRT-XAML
body: <p>In WPF, we can update the underlying data model whenever the user makes any change to the data by leveraging UpdateSourceTrigger like this:</p>
  
  <pre><code>&lt;TextBox Text="{Binding Path=TextProperty, UpdateSourceTrigger=PropertyChanged}"/&gt;
  </code></pre>
  
  <p>In Window Phone UpdateSourceTrigger was not included in the XAML specification and to accomplish the same, a TextChanged handler was necessary like this:</p>
  
  <pre><code>(sender as TextBox).GetBindingExpression(TextBox.TextProperty).UpdateSource();
  </code></pre>
  
  <p>In Windows 8, I assumed that UpdateSourceTrigger would also be omitted - I was correct. I was surprised, however, to learn that GetBindingExpression() was also missing.</p>
  
  <p>What is the best technique to accomplish, in Windows 8, what we accomplished in WPF with UpdateSourceTrigger and in Windows Phone with GetBindingExpression().UpdateSource()?</p>
  
  <blockquote>
    <p>Please note: This question is for Windows 8 (Metro) development; this other question ( <a href="https://stackoverflow.com/questions/4833100/updatesourcetrigger-propertychanged-equivalent-for-a-windows-phone-7-textbox">&quot;UpdateSourceTrigger=PropertyChanged&quot; equivalent for a Windows Phone 7 TextBox</a> ) is for Windows Phone development - not to be confused.</p>
  </blockquote>
  
  <p>As a matter of research, <a href="http://xaml.codeplex.com/SourceControl/changeset/view/99885#1997429" rel="nofollow noreferrer">this example</a> (which I created) uses a TextBox override to swap the text value between two properties causing the update. It is based on <a href="http://www.familie-smits.com/post/2012/07/29/UpdateSourceTrigger-in-WinRT.aspx" rel="nofollow noreferrer">this</a>. But, is there a better way? Something elegant?</p>