WPF ScrollViewer无法触摸滚动的问题
ScrollViewer属性设置IsManipulationEnabled="True" PanningMode="VerticalOnly"
设置后,ScrollViewer里面如果还有控件再存在滚动操作,就无法触摸滚动了
所以如果里面的控件Canvas在存在滚动操作,那么可以给控件Canvas增加事件MouseEnter和MouseLeave,并且调整ScrollViewer的属性IsManipulationEnabled即可
private void Canvas_OnMouseEnter(object sender, MouseEventArgs e) { GridScrollViewer.IsManipulationEnabled = false; } private void SCanvas_OnMouseLeave(object sender, MouseEventArgs e) { GridScrollViewer.IsManipulationEnabled = true; }