title: Binding string to a TextBlock WPF - What I'm doing wrong?
body: <p>I read some threads which explain binding on WPF, but when I wrote that code, it doesn't bind me the string to my TextBlock, and I did not know why.</p>
  
  <p>Help?</p>
  
  <p><strong>XAML</strong></p>
  
  <pre><code>        &lt;TextBlock x:Name="myTextBlock"
                 Text="{Binding Name, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" /&gt;
  </code></pre>
  
  <p><strong>C#</strong></p>
  
  <pre><code>public partial class MainWindow : Window, INotifyPropertyChanged
  {
      public MainWindow()
      {
          InitializeComponent();
          _name = "Jones";
          myTextBlock.DataContext = Name;          
      }
  
      private string _name;
      public string Name
      {
          get
          {
              return _name;
          }
          set
          {
              _name = value;
              OnPropertyChanged("Name");
          }
      }
  
      // property changed event
      public event PropertyChangedEventHandler PropertyChanged;
      private void OnPropertyChanged(string property)
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(property));
          }
      }
  }
  </code></pre>