问题
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