动态修改VCD windows 8.1(RT)

时间:2015-12-10 14:09:39

标签: c# windows-runtime windows-phone-8.1 cortana vcd

我正在尝试修改我从应用程序动态创建的VCD。我参考了各种文章/文件。我有以下代码:

Windows.ApplicationModel.VoiceCommands.VoiceCommnadDefinition.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”});

我在我的应用程序中使用它,它表明在ApplicationModel下没有名为VoiceComands的类。 我认为它可能适用于Windows 10,所以我深入挖掘并提出了一个VoiceCommandManager类,它也没有我需要的枚举。任何人都可以帮我动态修改我的Windows Phone 8.1(RunTime)VCD。提前谢谢。

1 个答案:

答案 0 :(得分:1)

        Windows.Media.SpeechRecognition.VoiceCommandSet commandSetEnUs;

        if (Windows.Media.SpeechRecognition.VoiceCommandManager.InstalledCommandSets.TryGetValue("AdventureWorksCommandSet_en-us", out commandSetEnUs))
        {
            await commandSetEnUs.SetPhraseListAsync(
              "destination", new string[] { "London", "Dallas", "New York", "Phoenix" });
        }