ShakeGesture 库 WP7 - 摇动计数
我一直在阅读有关您的 ShakeGesture 库的信息,它真的很棒! 但我想知道是否有一种方法可以使用这个库来计算摇晃的次数。 例如,我想要一个应用程序,用户需要摇动手机 30 次。如果用户摇动它 10 次,就会发生一些事情。如果20次,就会发生其他事情。
这样的事情可能吗?
i've being reading about your ShakeGesture library and it's really good!
But i was wondering if there is a way for use this library for count the numbers of a shake.
For example, i want to have an app where the user needs to shake the phone 30 times. If the user shakes it 10 times, something will happen. If 20 times, other thing will happen.
Is something like this possible?
ShakeGesture 库不包含报告有多少个的方法设备因晃动而移动的次数。
但是,它确实允许您自定义
MinimumRequiredMovesForShake
。您可以尝试创建侦听器的多个实例,每个实例配置为侦听不同数量的移动,然后以不同的方式处理事件。The ShakeGesture library doesn't include a way of reporting how many times a device was moved as part of a shake.
However, it does allow you to customize the
MinimumRequiredMovesForShake
. You could try creating multiple instances of the listener, each configured to listen for a different number of moves and then handle the events differently.