Search code examples
windowsuwpwindows-store-appsappbar

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


I have an application that is already on the Windows 10 Store. It has an AppBar with items, such as File, Edit, Help.

When I right click on any control inside the app, say ListView, the AppBar shows up. Why?

I want to create context menu for ListView, but the context menu isn't showing up, because AppBar becomes focused? How can I prevent this?

Note: if I comment out AppBar in xaml, everything is working as expected.


Solution

  • Try changing the AppBar to CommandBar which is really similar and recommended in 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)