Faking WPF Manipulation Events

。_饼干妹妹 提交于 2019-12-05 05:29:10

问题


I want to fake manipulation (or touch) events using a mouse / keyboard. When I try to raise the events using:

RoutedEventArgs e = new RoutedEventArgs(ManipulationStartedEvent,this);
RaiseEvent(e);

Gives me the error "Cannot convert RoutedEventArgs to ManipulationStartedEventArgs, and attempting to create a new ManipulationStartedEventArgs results in an error as there are no constructors for ManipulationStartedEventArgs.

Is it possible to do this?


回答1:


So the answer is to create a Custom Touch Device by extending the Touch Device class with appropriate mouse inputs.

An example using Microsoft Multipoint SDK (Multi-Mouse).



来源:https://stackoverflow.com/questions/4991536/faking-wpf-manipulation-events

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!