WPF中的滑块控件无法正常工作,因为我正在寻找。为多点触控应用程序创建我自己的滑块
我需要在同一时间上滑动2点不同的控制(滑块)(每个一个手指)。 当我触摸第一个滑块时,它将获得所有的焦点,而我无法使用第二个触摸设备触摸其他任何东西。
所以我需要创建自己的滑块(MySlider)从滑块继承。 我做了4种方法:
protected override void OnTouchDown(TouchEventArgs e)
protected override void OnTouchUp(TouchEventArgs e)
protected override void OnTouchLeave(TouchEventArgs e)
protected override void OnTouchMove(TouchEventArgs e)
但有移动滑块酷似鼠标的方法吗?或者我需要每次我触摸设备搬到像到calcule:
protected override void OnTouchMove(TouchEventArgs e)
{
base.OnTouchMove(e);
if (this.Value <= this.Maximum && this.Value >= this.Minimum)
{
Point newPoint = e.GetTouchPoint(this).Position;
this.Value += (this.lastPoint.Y - newPoint.Y);
lastPoint = newPoint;
}
e.Handled = true;
}
而且在这种情况下,运动不以相同的速度移动手指...
没有人能帮助我解决这个问题吗?为多点触控创建我自己的滑块... – mlemay 2012-01-17 18:26:28