问题
I have a UWP application where I am trying to enable manipulation events on the UI elements. I subscribed to the ManipulationStarted event but realized that it was not firing. Then, based on some suggestions, I tried setting IsManipulationEnabled property on the Grid but started getting compilation error saying that IsManipulationEnabled property could not be found. Am I missing out on something?
回答1:
IsManipulationEnabled is a WPF property. In order to get manipulation events in UWP, you'll have to set the ManipulationMode property.
From the Remarks section on the ManipulationMode page:
You must set the ManipulationMode to a value other than System or None if you want to handle manipulation events such as ManipulationStarted from UI elements in your app code.
E.g.
ManipulationMode = ManipulationModes.Scale
| ManipulationModes.TranslateX
| ManipulationModes.TranslateY
| ManipulationModes.TranslateInertia;
来源:https://stackoverflow.com/questions/37518636/no-ismanipulationenabled-property-in-uwp