title: WPF: refreshing a control with a bound property using Model View View-Model
body: <p>I am using the Model View View-Model pattern for a WPF app. I have a ViewModel (set as a pages DataContext) with two properties, one of which is an Entity with a PropertyChanged event. In the event handler i set the value of the other property (a boolean) to some value.</p>
  
  <p>Now the Button and TextBox properties are binding fine on first load and the PropertyChanged event is firing and doing its thing. However the Button's IsEnable property doesn't update to reflect the change in the property its bound to.</p>
  
  <p>The ViewModel looks sorta like this:</p>
  
  <pre><code>public sealed class CustomerPageViewModel
  { 
      public Customer Customer
      {
          get;
          set;
      }
  
      public bool Editing
      {
          get;
          private set;
      }   
  
      private void Customer_PropertyChanged(object sender,
          System.ComponentModel.PropertyChangedEventArgs e)
      {
          Editing = true;
      }
  }
  </code></pre>
  
  <p>And the xaml sorta looks like this:</p>
  
  <pre><code>&lt;TextBox Text="{Binding Customer.Name}" /&gt;   
  &lt;Button Content="Save Changes" IsEnabled="{Binding Editing}" /&gt;
  </code></pre>
  
  <p>How can i get the Button to update its IsEnable property when i change the underlying property in the ViewModel?</p>