title: With compiled bindings (x:bind), why do I have to call Bindings.Update()?
body: <p>I'm currently experimenting with the new compiled bindings and have reached (again) a point where I'm missing a pice in the puzzle: why do I have to call <code>Bindings.Update</code>? Until now, I thought implementing  <code>INotifyPropertyChanged</code> is enough?</p>
  
  <p>In my example, the GUI is only displaying correct values, if I call this mysterious method (which is autogenerated by the compiled bindings).</p>
  
  <p>I am using a user control with the following (here simplified) xaml syntax:</p>
  
  <pre><code>&lt;UserControl&gt;
    &lt;TextBlock Text="x:Bind TextValue"/&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>where <code>TextValue</code> is a simple dependency property of this user control. In a page, I'm using this control as:</p>
  
  <pre><code>&lt;Page&gt;
    &lt;SampleControl TextValue="{x:Bind ViewModel.Instance.Name}"/&gt;
  &lt;/Page&gt;
  </code></pre>
  
  <p>where:</p>
  
  <ul>
  <li><code>ViewModel</code> is a standard propery which is set before <code>InitializeComponent()</code> is run</li>
  <li><code>Instance</code> is a simple object implementing <code>INotifyPropertyChanged</code></li>
  </ul>
  
  <p>After loading <code>Instance</code>, i raise a property changed event for <code>Instance</code>. I can even debug to the line, where the depency property <code>TextValue</code> of user control gets the <strong>correct</strong> value -- but nothing is displayed. Only if I call <code>Bindings.Update()</code>, the value is displayed. What am I missing here?</p>
  
  <p><strong><em>Update</em></strong></p>
  
  <p>I doesn`t work with <code>{x:Bind ... Mode=OneWay}</code> either.</p>
  
  <p><strong><em>More code</em></strong></p>
  
  <p><em>Person.cs</em>:</p>
  
  <pre><code>using System.ComponentModel;
  using System.Threading.Tasks;
  
  namespace App1 {
      public class Person : INotifyPropertyChanged {
          public event PropertyChangedEventHandler PropertyChanged;
  
          private string name;
          public string Name { get {
                  return this.name;
              }
              set {
                  name = value;
                  if (PropertyChanged != null)
                      PropertyChanged(this, new PropertyChangedEventArgs("Name"));
              }
          }
      }
  
      public class ViewModel : INotifyPropertyChanged {
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          private Person instance;
          public Person Instance {
              get {
                  return instance;
              }
              set {
                  instance = value;
                  if (PropertyChanged != null)
                      PropertyChanged(this, new PropertyChangedEventArgs("Instance"));
              }
          }
  
          public Task Load() {
              return Task.Delay(1000).ContinueWith((t) =&gt; {
                  var person = new Person() { Name = "Sample Person" };                
                  this.Instance = person;
              });
          }
  
  
      }
  }
  </code></pre>
  
  <p><em>SampleControl.cs</em>:</p>
  
  <pre><code>&lt;UserControl
      x:Class="App1.SampleControl"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:App1"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      d:DesignHeight="100"
      d:DesignWidth="100"&gt;
  
      &lt;TextBlock Text="{x:Bind TextValue, Mode=OneWay}"/&gt;
  
  &lt;/UserControl&gt;
  </code></pre>
  
  <p><em>SampleControl.xaml.cs</em>:</p>
  
  <pre><code>using Windows.UI.Xaml;
  using Windows.UI.Xaml.Controls;
  
  namespace App1 {
      public sealed partial class SampleControl : UserControl {
  
          public SampleControl() {
              this.InitializeComponent();
          }
  
          public string TextValue {
              get { return (string)GetValue(TextValueProperty); }
              set { SetValue(TextValueProperty, value); }
          }
  
          public static readonly DependencyProperty TextValueProperty =
              DependencyProperty.Register("TextValue", typeof(string), typeof(SampleControl), new PropertyMetadata(string.Empty));
  
      }
  }
  </code></pre>
  
  <p><em>MainPage.xaml</em>:</p>
  
  <pre><code>&lt;Page
      x:Class="App1.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:App1"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"&gt;
  
      &lt;StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"&gt;
          &lt;local:SampleControl TextValue="{x:Bind ViewModel.Instance.Name, Mode=OneWay}"/&gt;
      &lt;/StackPanel&gt;
  &lt;/Page&gt;
  </code></pre>
  
  <p><em>MainPage.xaml.cs</em>:</p>
  
  <pre><code>using Windows.UI.Xaml;
  using Windows.UI.Xaml.Controls;
  
  namespace App1 {
  
      public sealed partial class MainPage : Page
      {
          public MainPage()
          {
              this.DataContext = new ViewModel();
              this.Loaded += MainPage_Loaded;
              this.InitializeComponent();
          }
  
          public ViewModel ViewModel {
              get {
                  return DataContext as ViewModel;
              }
          }
  
          private void MainPage_Loaded(object sender, RoutedEventArgs e) {
              ViewModel.Load();
              Bindings.Update(); /* &lt;&lt;&lt;&lt;&lt; Why ????? */
          }
      }
  }
  </code></pre>
  
  <p><strong><em>One more update</em></strong></p>
  
  <p>I updated the <code>Load</code> method to use task (see the code above)!</p>