如果在容器控上挂上鼠标事件(MouseDown,MouseMove, etc..) 然后在容器控件上触发鼠标事件,会出现事件无法捕捉的情况,比如:
<StackPanel Width="200" Height="200" MouseLeftButtonDown="ButtonDown">
<TextBlock x:Name="he" >xxxx</TextBlock>
</StackPanel>
如果在ButtonDown 事件处理代码中写上Console.WriteLine("event fired"); 会发现字符串“event fired”并不会输出,如果要让事件被捕获,只能将事件侦听放在容器控件的父控件上,比如Window