UWP:应用程序顶部栏总是在右键单击时显示,如何防止它?

UWP: App Top Bar always shows on right click, how to prevent it?

我有一个应用程序已经在 Windows 10 商店中。它有一个包含文件、编辑、帮助等项目的 AppBar。

当我右键单击应用程序内的任何控件(例如 ListView)时,AppBar 会出现。为什么?

我想为 ListView 创建上下文菜单,但是上下文菜单没有显示,因为 AppBar 变得有焦点了?我该如何防止这种情况?

注意:如果我在 xaml 中注释掉 AppBar,一切都会按预期工作。

尝试将 AppBar 更改为 CommandBar,这非常相似并在 UWP 中推荐。

XAML provides both the AppBar control and the CommandBar control. You should use the AppBar only when you are upgrading a Universal Windows 8 app that uses the AppBar, and need to minimize changes. For new apps in Windows 10, we recommend using the CommandBar control instead. (Command bar)