2015-12-10 22 views
4

我想修改從應用程序動態創建的VCD。我提到各種文章/文件。我有以下代碼:動態修改VCD窗口8.1(RT)

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」}); 

我用它在我的應用程序,並且聲明沒有應用模型下名爲VoiceComands類。 我認爲它可能適用於Windows 10,所以我深入挖掘並想出了一個VoiceCommandManager類,它也沒有我需要的枚舉。任何人都可以幫助我動態修改我的Windows Phone 8.1(RunTime)VCD。提前致謝。

回答

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" }); 
     } 
+1

謝謝你的回覆。這不起作用。它在VoiceCommandService中給我一個錯誤,指出它在當前上下文中不存在,並給出標準修復(生成方法等)。任何想法,如果他們已經改變了API的其他東西? –

+0

對不起,我在Silverlight應用程序中測試過它。我明白我能找到什麼。我知道我之前在8.1運行時應用程序中使用過它。 – DevEnitly

+0

請做。我很在這裏。我需要使用c#for windows phone 8.1(RunTime)動態修改一個vcd文件。 –