首页 > 解决方案 > 如何从 Cortana 动态清除自定义 VCD 命令?

问题描述

我有一个带有 VCD 的 UWP 应用程序,我可以让 Cortana 识别我的测试命令(正常工作)。但是,我希望能够整理所有自定义命令(理想情况下,通过识别 appname/command 前缀和命令,通过完全擦除 appname/command 前缀失败,无法擦除所有自定义命令)。

这是我的工作 VCD:

<?xml version="1.0" encoding="utf-8" ?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
  <CommandSet xml:lang="en-gb" Name="VoiceDemoCommandSet_en-us">
        <AppName>Do</AppName>
        <Example>Placeholder</Example>

        <Command Name="Test">
            <Example>a test</Example>
            <ListenFor RequireAppName="BeforePhrase">a test</ListenFor>
            <Feedback>You've triggered the test command</Feedback>
            <Navigate />
        </Command>
  </CommandSet>
</VoiceCommands>

例如,如何清除已注册的“执行测试”命令?

标签: uwpcortanavcd

解决方案


如何从 Cortana 动态清除自定义 VCD 命令?

来源于官方文档,VoiceCommandDefinitionManager仅包含InstallCommandDefinitionsFromStorageFileAsync,并没有这样的api可以卸载已安装的命令文件。恐怕您无法删除已安装的命令文件,如果您确实需要此功能,请使用 Windows 反馈中心应用程序发布您的要求。


推荐阅读