title: Cause Property to Fire Toggle Checkbox WPF DataGrid
body: <p>How can I get a property change to register for a checkbox toggling? I'd like my Save button to enable when a checkbox is toggled but cannot get the property change to fire so I can call RaiseCanExecuteChanged. My checkbox is in a DataGrid. IsGeneric is a property of ProgramsSelected I added the property to my view model to see if that would help but it did not.</p>
  
  <p>XAML</p>
  
  <pre><code>&lt;DataGrid ItemsSource="{Binding Programs}"
            SelectedItem="{Binding ProgramSelected}"
      &lt;DataGrid.Columns&gt;
           &lt;DataGridCheckBoxColumn Binding="{Binding IsGenericView, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Header="Is Generic" /&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  
  &lt;Button Command="{Binding SaveProgramsCommand}" Content="Save Programs" /&gt;
  </code></pre>
  
  <p>Program Class</p>
  
  <pre><code>namespace OPP.Models
  {
      using SimpleMvvmToolkit;
  
      public class Program : ModelBase&lt;Program&gt;
      {
          private bool isGenericView;
  
          public string Name { get; set; }
  
          public string Value { get; set; }
  
          public bool IsGenericView
          {
              get
              {
                  return this.isGenericView;
              }
  
              set
              {
                  this.isGenericView = value;
  
                  this.NotifyPropertyChanged(m =&gt; m.IsGenericView);
              }
          }
  
          public bool ShowAtTop { get; set; }
      }
  }
  </code></pre>
  
  <p>ViewModel</p>
  
  <pre><code>public class ManageProgramsViewModel : ViewModelDetailBase&lt;ManageProgramsViewModel, Program&gt;
  {
      public ICommand SaveProgramsCommand
      {
      get
      {
          return this.saveProgramsDelegate
              ?? (this.saveProgramsDelegate = Helpers.DelegateCommandFactory.CreateCommand(this.SavePrograms, this.CheckCanSavePrograms));
      }
      }
  }
  
  public ObservableCollection&lt;Program&gt; Programs
  {
      get
      {
          return this.Programs;
      }
  
      private set
      {
          this.programs = value;
  
          this.NotifyPropertyChanged(m =&gt; m.Programs);
      }
  }
  
  public Program ProgramSelected
  {
      get
      {
          return this.programSelected;
      }
  
      private set
      {
          this.programSelected = value;
  
          this.NotifyPropertyChanged(m =&gt; m.ProgramSelected);
      }
  }
  
  public bool IsGenericView       // Never hits the breakpoint when I check or uncheck my checkbox
  {
      get
      {
          return this.isGenericView;
      }
  
      set
      {
          this.isGenericView = value;
  
          this.NotifyPropertyChanged(m =&gt; m.IsGenericView);
  
          this.CanSavePrograms = !this.CanSavePrograms;
      }
  }
  
  public bool CanSavePrograms
  {
      get
      {
          return this.canSavePrograms;
      }
  
      set
      {
          this.canSavePrograms = value;
  
          Helpers.DelegateCommandFactory.RaiseCanExecuteChanged(this.SaveProgramsCommand);
      }
  }
  </code></pre>