【发布时间】:2018-05-17 22:36:29
【问题描述】:
我正在寻找一种方法来动态填充我的 VCD 文件。我有一个来自 Windows 文档的代码 sn-p,内容如下:
Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinition.VoiceCommandSet commandSetEnUs;
if (Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.
InstalledCommandSets.TryGetValue(
"AdventureWorksCommandSet_en-us", out commandSetEnUs))
{
await commandSetEnUs.SetPhraseListAsync(
"destination", new string[] {“London”, “Dallas”, “New York”, “Phoenix”});
}
但是,当我将它放入我的 App.OnActivated() 版本时,Visual Studio 显示一个错误,指出 VoiceCommandSet 不包含在“Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinition”中。我的问题是:
我这样做是不是在错误的地方?你知道任何示例项目,显示如何正确地做到这一点? (我查看了 Adventure Works,但没有在那边找到这些行)还是我遗漏了一些我不知道的参考资料?
【问题讨论】:
-
同时我发现 AdventureWorks 在 TripViewModel.UpdateDestinationPhraseList 中这样做