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 used to prevent Checkbox.Checked event by checking if it is focused or not. Because when it fires from binding it is not Focused, but when you click on it than it is focused.

```
 if(cbo.IsFocused){ // code here }

```

Hope this helps.
Blerim.