title: WPF binding checked event in MVVM
body: <p>I'm new to MVVM pattern, I must intercept the checked/unchecked operation inside a the following view </p>
  
  <p><strong>SendMessageView.xaml</strong></p>
  
  <pre><code>&lt;ListBox.ItemTemplate&gt;
     &lt;DataTemplate&gt;
        &lt;StackPanel&gt;
           &lt;CheckBox Checked="Specialita_Checked" 
                  Unchecked="Specialita_Unchecked"
                  Content="{Binding Path=Item.Name}"
                  IsChecked="{Binding RelativeSource={RelativeSource FindAncestor,
                              AncestorType={x:Type ListBoxItem}}, 
                              Path=IsSelected,Mode=TwoWay}"/&gt;
        &lt;/StackPanel&gt;
     &lt;/DataTemplate&gt;
  &lt;/ListBox.ItemTemplate&gt;
  </code></pre>
  
  <p><strong>SendMessageView.xaml.cs</strong></p>
  
  <pre><code>private void Specialita_Checked(object sender, System.Windows.RoutedEventArgs e)
  {
     var aSendMessageViewModel = (SendMessageViewModel)this.DataContext;
     if (aSendMessageViewModel != null)
     {
        var aCheckBox = (CheckBox)sender;
        aSendMessageViewModel.AddSpecialita(aCheckBox.Content.ToString());
     }
  }
  </code></pre>
  
  <p>A file called <code>aSendMessageViewModel.cs</code> is call inside a <code>SendMessageView.xaml.cs</code> and this is not correct.
  Help me in correctly using MVVM pattern.</p>