Question: I have a lots of controls in a Window including checkboxes and comboboxes. I want to track CheckBox.IsChecked event, so I defined an event handler in Windows level as

```
<Grid CheckBox.Checked="OnModified" CheckBox.Unchecked="OnModified">

```

The problem is that the same event is also fired by ComboBox right after mouse clicking an item. I thought my event handler should only capture CheckBox's Checked event, not ToggleButton's. Did I miss anything?

EDIT: 
As I pointed out below, I thought it would work this way because I read **Matthew MacDonald's** book "**Pro WPF in C# 2010**". **On page 164**, he gave this example code first:

```
<StackPanel Button.Click="DoSomething" Margin="5">   
  <Button Name="cmd1">Command 1</Button> 
  <Button Name="cmd2">Command 2</Button> 
  <Button Name="cmd3">Command 3</Button> 
  ... 
</StackPanel>  

```

Then, he specially noted:

> 
> Note The Click event is actually
>  defined in the ButtonBase class and
>  inherited by the Button class. If you
>  attach an event handler to
>  ButtonBase.Click, that event handler
>  will be used when any
>  ButtonBase-derived control is clicked
>  (including the Button, RadioButton,
>  and CheckBox classes). If you attach
>  an event handler to Button.Click, 
>  it’s only used for Button objects.
> 
> 
> 

Now, did I misunderstand him, or is his note wrong?

Answer: 
its because you are setting the event on the grid, so any children contained by the grid that have a `Checkbox.Checked` routed event will respond to the event. In your case, it happens that the `ComboboxItem` uses the same routed event (and I am sure other controls probably reuse it as well) 

the easiest way to handle this would be to add a test to your handler, something like this:

```
private void OnModified(object sender, EventArgs args)
{
    if ( sender is CheckBox )
    {
        CheckBox ckBox = sender as CheckBox;
        // do stuff with ckBox
    }
}

```
I'm the author of "Pro WPF in C# 2010" and I can confirm that the text from the Note box falls under the "what was I smoking?" category. There is no distinction between the Click event based on how you refer to it in your markup.

Matthew