tags:

views:

30

answers:

1

I have this situation:

<Button MouseDown="Button_MouseDown" Click="Button_Click">
    <TextBlock MouseDown="Inner_MouseDown">Button</TextBlock>
</Button>

Method Inner_MouseDown is completely empty. .Handled is NOT set to true. But Button_Click is not executed. If I remove the MouseDown="Inner_MouseDown",button clicks without problems. Can anybody help me find out why handling MouseDown with no logic prevents button from click?

Thanks a lot.

Andrej

A: 

OK, I found out something important. It seems that it works good until I add breakpoint to Inner_MouseDown method. If debugger stops there Click event is not raised. If I just remove the breakpoint it works allright. Same problem if I show messagebox in the Inner_MouseDown method. If I just increment some temp variable it works nice.

But this answers my question, why it does not work even if it should. Actually it works, problem is somewhere else.

Andrej
Heisenbug? http://en.wikipedia.org/wiki/Unusual_software_bug
Robaticus