title: Binding CheckBox Command
body: <p>I have a checkbox for each row in the listview. I want to bind the Checkbox OnClick to my command in the view model. But its not binding to my Command. What should I do? Below is my xaml and Viewmodel </p>
  
  <p>Xaml:</p>
  
  <pre><code>&lt;Grid&gt;
          &lt;ListView Name="lstdemo" ItemsSource="{Binding obcollection}"&gt;
              &lt;ListView.View&gt;
                  &lt;GridView&gt;
                      &lt;GridView.Columns&gt;
                          &lt;GridViewColumn&gt;
                              &lt;GridViewColumn.CellTemplate&gt;
                                  &lt;DataTemplate&gt;
                                      &lt;CheckBox Name="chk" IsChecked="{Binding IsChecked,Mode=TwoWay,NotifyOnTargetUpdated=True}" Command="{Binding Path=UpdateCommand}" /&gt;
                                  &lt;/DataTemplate&gt;
                              &lt;/GridViewColumn.CellTemplate&gt;
                          &lt;/GridViewColumn&gt;
                          &lt;GridViewColumn DisplayMemberBinding="{Binding Name}" Header="Name" /&gt;
                      &lt;/GridView.Columns&gt;
                  &lt;/GridView&gt;
              &lt;/ListView.View&gt;
  
          &lt;/ListView&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>ViewModel:</p>
  
  <pre><code>public class MyViewModel
      {
          private List&lt;Demo&gt; lstdemo;
          private ObservableCollection&lt;Demo&gt; Obcollection;
          private SampleDb db;
          public MyViewModel()
          {
              db = new SampleDb();
              lstdemo = db.Demoes.ToList();
              Convert();
  
          }
  
          public void Convert()
          {
              Obcollection = new ObservableCollection&lt;Demo&gt;(lstdemo);
          }
  
          public ObservableCollection&lt;Demo&gt; obcollection
          {
              get { return Obcollection; }
              set { Obcollection = value; }
          }
  
          private ICommand mUpdater;
          public ICommand UpdateCommand
          {
              get
              {
                  if (mUpdater == null)
                      mUpdater = new Updater();
                  return mUpdater;
              }
              set
              {
                  mUpdater = value;
              }
          }
  
          public class Updater : ICommand
          {
              #region ICommand Members
  
              public bool CanExecute(object parameter)
              {
  
                  return true;
              }
  
              public event EventHandler CanExecuteChanged;
  
              public void Execute(object parameter)
              {
                  if (parameter == null)
                  {
                      MessageBox.Show("Hello");
                  }
  
              }
  
              #endregion
          }
  
      }
  </code></pre>