离散手势基础知识WPF [英] Discrete Gesture Basics WPF
问题描述
嘿!
如果我在离散的手势基础知识中加载我的数据库的所有可用手势wpf只检测到数据库中的最后一个手势。
If I load all available gestures of my database in discrete gesture basics wpf only the last gesture in databse gets detected.
我正在使用此代码加载数据库:
I am using this code to load database:
this.vgbFrameSource.AddGestures(database.AvailableGestures);
this.vgbFrameSource.AddGestures(database.AvailableGestures);
        }
}
我是否必须更改原始代码示例中的任何其他内容才能检测每个动作?
Do I have to change anything else in the original code sample in order to detect every single gesture?
谢谢
推荐答案
您必须为每个手势创建一个来源。您将在示例中注意,它是迭代AvailableGestures的集合,只查找特定的(this.seatedGestureName)。一旦找到,就会将其添加到单一来源。 你
可以在那里放一个休息点; if语句中的语句使其更加明显。
You must create a source for every gesture. You will note in the sample it is iterating the collection of AvailableGestures and only looking for a specific one(this.seatedGestureName). Once that is found it is added to the single source. You can put in there a break; statement in the if statement to make it more obvious.
如果你想以不同的方式做,你需要先确定数据库中有多少手势。创建VisualGestureBuilderFrameSource / Readers的集合/数组,然后将每个手势添加到其源。
If you want to do it differently, you need to determine how many gestures are in the database first. Create a collection/array of VisualGestureBuilderFrameSource/Readers and then add each gesture to its source.
这篇关于离散手势基础知识WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!