Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个自定义控件,它将鼠标单击事件传播到可视树上,我想摆脱这种行为。有没有办法将路由事件(由按钮单击或其他鼠标事件引发)标记为从我的 UserControl 中的 xaml 处理。
你可以e.Handled = true;用来尝试吞下事件。虽然按钮点击事件不应该冒泡。
e.Handled = true;