WPF中一旦IsHitTestVisible设置为False后,这个组件就再也无法响应鼠标等设备的点击测试了,也就不可能触发按钮了。
所以你要触发按钮,就不要设置这个属性为False。
你这么考虑,在拖拽开始设置这个属性为False,结束后设置回来。
或者还有思路,你考虑使用CaptureMouse把鼠标捕获在你的UserControl上,然后拖拽完了再释放,这样拖拽与里面的按钮点击互不干扰。
Sincerely,
Bob Bao [MSFT]
MSDN Community Support |
Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
