How can I add a context menu to UI element in MAUI?

Nikolay Kusch

The code below is not working, Error XLS0415 The attachable property 'ContextActions' was not found in type 'Grid' and "The type 'FlyoutBase' was not found"

<Grid.ContextActions>
    <MenuItem Text="Test"/>
    <MenuItem Text="Test 2"/>
</Grd.ContextActions>
<FlyoutBase.ContextFlyout>
    <MenuFlyout>
        <MenuFlyoutItem/>
    </MenuFlyout>
</FlyoutBase.ContextFlyout>
Gerald Versluis

The ContextActions can only be used in a ListView cell (see this). This enables a swipe to reveal some buttons on iOS and long press context menu on Android, but only for those cells.

If you want to use this on other elements you can have a look at SwipeView.

For desktop right-clicks we're working on context menus like those right now and they should be ready in .NET 7.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I add a context menu to the Windows Explorer for a Java application?

How can I add a Context Menu to a Table Layout?

How do I add a context menu to an app

How can I add a context menu for an entire row of a WPF grid?

How can I add a option to a GameObject in the Hierarchy context menu?

How can I add a Click Event Handler to a DataGrid Context Menu?

How can I add a custom item to the nautilus context menu, but NOT in a sub-menu?

How can I add an icon to my custom context menu item in Windows 7?

How can I add an item to the 'new' context menu?

How can I add a program to the context menu of all files?

How can I add a specific action for a file in context-menu on Windows?

How can I assign a context menu to a toolstrip menu item in winform?

How can I add to the context menu in Chrome's Omnibox(Address bar)?

How can I add a context menu to a browser action with a Chrome extension?

Can I add a key with right click to access the Firefox context menu?

How can I add an option in the context menu in Windows Explorer to split files by 15 GB chunks?

How can I add a context menu extension for the root directory?

Can I add a "new -> blank document" option to the context menu?

On Windows 7, the "Mount Image" Shell Extension Context Menu is missing. How can I add it again?

How can I add an option to the context menu dynamically in a Chrome extension?

In Ubuntu 17.10, how can I add entries to the right click context menu, like "open in terminal"?

How can i add a context menu to a richTextBox control?

How can I programmatically add a Context Menu Strip to all controls on a win Form in c#

How can I add Reformat Code option to Right Click context menu in Android Studio?

How can I add context menu on listview item right click with the mouse?

How can I get jQuery-ui menu element id

how can i make a dynamic context menu

How to get MAUI UI element absolute coordinates

How can i use UsageStatsManager in .NET MAUI