No IsManipulationEnabled property in UWP

 ̄綄美尐妖づ 提交于 2019-12-11 06:12:51

问题


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

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