Search code examples
c#windows-8microsoft-metrowindows-runtimeappbar

Metro App Conditionally Disable AppBar RightTapped event


Whenever a right click is detected on a metro app, the AppBar is displayed.

How do I cancel/disable/prevent the AppBar from showing if the RightTapped event is triggered by right clicking on a specific control?


Solution

  • RightTapped is a routed event and its event args includes the Handled property. So in whatever control you are processing the event, add the following code at the end to suppress the AppBar.

    e.Handled = true;