Are there any examples of using SyncFusion/Maui to provide a context or dropdown menu?

I'm investigating the ability to create a context menu/dropdown menu class using SyncFusion.

I have two use cases:

1: A context menu for a TreeView or ListView

2: A dropdown menu bound to a UI element that has a Command property.  

I've been able to accomplish #2 using an SfComboBox but the implementation is rather convoluted. (see below) and it doesn't lend itself to #1.  

I've just started digging into SfPopup to see if I can provide a general solution for both.  Is this a viable path? If so, are there any examples I can review?

Here's a rough list of what I'd like to accomplish:

1: Fully templated view

2: Auto-sized based on content (Ideally dynamic auto-sizing).

3: Auto-dismiss when clicking outside the 'menu'

4: Auto or programmatic dismiss of the menu when executing a command within the menu.

5: Absolute positioning.

Thanks,

Dan.


Image_9815_1706888794377


3 Replies

SY Suthi Yuvaraj Syncfusion Team February 6, 2024 02:58 PM UTC

Hi Daniel Travison,

We have checked your requirements,we have successfully addressed your requirements. We have developed a concise example that emulates a context menu behavior. Upon a long-press event on an item, a popup is dynamically positioned below the selected item. Additionally, we have integrated a command for the button within the template.

It's essential to note that due to the limitations of obtaining the touch position accurately about the selected item during the LongPress event, we have strategically positioned the popup at the bottom right of the screen. This ensures a consistent and visually appealing user experience.

If you have any questions or concerns regarding this implementation, please feel free to let us know. We are here to assist you further.


Regards,

Suthi Yuvaraj


Attachment: ListViewMaui_2623f022.zip


DT Daniel Travison February 7, 2024 02:32 PM UTC

Thanks. The sample answers my questions.



SY Suthi Yuvaraj Syncfusion Team February 8, 2024 02:54 PM UTC

Daniel Travison,

We are glad to know that your problem has been resolved. Please let us know if you need any other assistance. We will be happy to assist you.


Loader.
Up arrow icon