伪造WPF操纵事件

伪造WPF操纵事件,wpf,multi-touch,Wpf,Multi Touch,我想用鼠标/键盘模拟操纵(或触摸)事件。当我尝试使用以下方式引发事件时: RoutedEventArgs e = new RoutedEventArgs(ManipulationStartedEvent,this); RaiseEvent(e); 给出错误“无法将RoutedEventTargets转换为OperationsStartedEventTargets,尝试创建新的OperationsStartedEventTargets会导致错误,因为OperationsStartedEventT

我想用鼠标/键盘模拟操纵(或触摸)事件。当我尝试使用以下方式引发事件时:

RoutedEventArgs e = new RoutedEventArgs(ManipulationStartedEvent,this);
RaiseEvent(e);
给出错误“无法将
RoutedEventTargets
转换为
OperationsStartedEventTargets
,尝试创建新的
OperationsStartedEventTargets
会导致错误,因为
OperationsStartedEventTargets
没有构造函数


有可能做到这一点吗?

因此,答案是通过使用适当的鼠标输入扩展Touch Device类来创建自定义触摸设备