Add native context menus to any view in your .NET MAUI application. Supports all major platforms: Windows, Android, iOS, macOS
| iOS | Android | macOS | Windows |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
dotnet add package ContextMenuContainer
Or via NuGet Package Manager.
- Initialize the component in your
MauiProgram.csby adding the extension method:
using APES.MAUI;
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
// Add this line to configure the context menu container
.ConfigureContextMenuContainer();- Add the namespace to your XAML file:
xmlns:apes="http://apes.ge"Wrap any view with the ContextMenuContainer and define your context menu items:
<apes:ContextMenuContainer>
<apes:ContextMenuContainer.MenuItems>
<apes:ContextMenuItem
Text="Copy"
Command="{Binding CopyCommand}"
CommandParameter="{Binding .}" />
<apes:ContextMenuItem
Text="Delete"
Command="{Binding DeleteCommand}"
CommandParameter="{Binding .}"
IsDestructive="True"
Icon="{Binding DeleteIconSource}"/>
</apes:ContextMenuContainer.MenuItems>
<apes:ContextMenuContainer.Content>
<Label Text="Long press or right-click me!"/>
</apes:ContextMenuContainer.Content>
</apes:ContextMenuContainer><apes:ContextMenuContainer MenuItems="{Binding ContextMenuItems}">
<apes:ContextMenuContainer.Content>
<Frame>
<Image Source="{Binding ImageSource}"/>
</Frame>
</apes:ContextMenuContainer.Content>
</apes:ContextMenuContainer>| Property | Type | Description |
|---|---|---|
Text |
string | The text label for the menu item |
Command |
ICommand | Command to execute when the item is tapped |
CommandParameter |
object | Parameter to pass to the command |
IsEnabled |
bool | Whether the item is enabled (default: true) |
IsDestructive |
bool | Marks the item as destructive (red text) |
Icon |
FileImageSource | Icon for the menu item |
To use icons in your context menu items:
- Add platform-specific image assets to the appropriate folders
- Bind to a
FileImageSourcefrom your ViewModel
SVG format is recommended for best cross-platform support.
- With Xamarin.Forms when used in a
CollectionVieworListViewitem template, there may be conflicts with the collection's own tap/selection events. Consider usingTapGestureRecognizerdirectly in these scenarios.
- Configure build scripts
- MAUI migration and support
- Add visibility property
- Add highlight property
- Add support for keyboard shortcuts
- Improve accessibility features
- Add support for submenus and separators
- Add font icon support
- Add comprehensive unit and UI tests
This project uses GitVersion for automatic versioning based on Git history and tags.
-
Tag-based versioning: Create a Git tag with the format
v{major}.{minor}.{patch}to specify the exact versiongit tag v1.2.0 git push origin v1.2.0
-
Commit message-based versioning: Include specific keywords in your commit message to trigger version increments
- Major version bump:
+semver:breakingor+semver:major - Minor version bump:
+semver:featureor+semver:minor - Patch version bump:
+semver:fixor+semver:patch
- Major version bump:
-
Branch-based versioning: The versioning behavior depends on the branch:
mainbranch: Patch increments, creates release versionsdevelopbranch: Minor increments withalphasuffixrelease/*branch: No increment withbetasuffixfeature/*branch: Inherits version with branch name suffixhotfix/*branch: Patch increment withbetasuffix
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes with appropriate version bump keywords if needed
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If this plugin saves you development time, please consider supporting its continued improvement:



