In the namespace Windows::UI::Popups
there is the PopupMenu
-class which provides exactly what I need. It creates a popup that is similar to a context-menu in classic Desktop-Applications.
First, create a new object using simply
Windows::UI::Popups::PopupMenu^ popupmenu = ref new Windows::UI::Popups::PopupMenu();
Afterwards, populate the popup with up to six items using
popupmenu->Commands->Append(ref new Windows::UI::Popups::UICommand("Do Something",
[this](IUICommand^ command){
//your action here
}));
Eventually, use the popup with your designated UIElement
like
popupmenu->ShowAsync(Windows::Foundation::Point(xArg, yArg));
The documentation is available on MSDN (rather poor, though). A sample project can be obtained from here.