开发者

Making WPF user control mark click events as handled

开发者 https://www.devze.com 2023-01-13 04:20 出处:网络
开发者_运维百科I have a custom controls which propagates the mouse click event up the visual tree and I would like to get rid of this behaviour. Is there a way to mark a routed event (which was raised
开发者_运维百科

I have a custom controls which propagates the mouse click event up the visual tree and I would like to get rid of this behaviour. Is there a way to mark a routed event (which was raised by button click or other mouse event) as handled from xaml in my UserControl.


you can use e.Handled = true; to try and swallow events. Although button click events shouldn't bubble.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号