开发者

Faking WPF Manipulation Events

I want to fake manipulation (or touch) events using a mouse / keyboard. When I try to raise the events usi开发者_如何学JAVAng:

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?


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜