WPF: Canvas swallowing MouseDownEvent?

后端 未结 1 1914
执笔经年
执笔经年 2020-12-21 15:28

Can anybody please explain to me why theMouseDownevent is not reaching theScrollViewerin this easy example?



        
1条回答
  •  粉色の甜心
    2020-12-21 16:01

    You will probably need to set Focusable="False" on the ScrollViewer to allow the mouse events to pass though

     
    

    Output:

    ScrollViewer_PreviewMouseDown
    Canvas_PreviewMouseDown
    Canvas_MouseDown
    ScrollViewer_MouseDown
    

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