gpt4 book ai didi

c# - Windows 手机 | VoiceCommand 能否导致方法调用而不是导航

转载 作者:太空宇宙 更新时间:2023-11-03 15:59:52 24 4
gpt4 key购买 nike

我有 VoiceCommand 几乎就像这个例子一样:

<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.0">
<CommandSet xml:lang="en-US">
<CommandPrefix>Contoso Rodeo</CommandPrefix>
<Example> play a new game </Example>

<Command Name="PlayUnknownLevel">
<Example> replay level two </Example>
<ListenFor> [and] replay level {*} </ListenFor>
<Feedback> Unknown level; going to level selection... </Feedback>
<Navigate Target="LevelSelect.xaml" />
</Command>

...

</CommandSet>
</VoiceCommands>

VoiceCommand 被识别时,我需要调用一些方法

问题是:VoiceCommand 能否导致方法调用而不是导航?

最佳答案

您可以通过处理导航目标的 OnNavigatedTo() 来调用方法。

这个页面有一个很好的例子:http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206959(v=vs.105).aspx

关于c# - Windows 手机 | VoiceCommand 能否导致方法调用而不是导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21904480/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com