WPF MouseDown event not firing everywhere in a control

后端 未结 1 423

I am currently fighting against another WPF struggle, namely mouse events.

I basically have a very simple control (a Border containing a Grid

相关标签:
1条回答
  • 2020-12-16 11:15
    <StackPanel Background="Transparent" ... >
    

    or

    <Border Background="Transparent" ... >
    

    should do the trick...

    This makes the grid transparent, however visible for mouse-clicks.

    Look here form more Information.

    There are some other circumstances, where you have to use the PreviewXXX- event, this is when a child element "swallows" the event away, but in your case, the above should be what you're looking for.

    0 讨论(0)
提交回复
热议问题