ContextMenuContainer 1.3.1

dotnet add package ContextMenuContainer --version 1.3.1
                    
NuGet\Install-Package ContextMenuContainer -Version 1.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ContextMenuContainer" Version="1.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ContextMenuContainer" Version="1.3.1" />
                    
Directory.Packages.props
<PackageReference Include="ContextMenuContainer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ContextMenuContainer --version 1.3.1
                    
#r "nuget: ContextMenuContainer, 1.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=ContextMenuContainer&version=1.3.1
                    
Install as a Cake Addin
#tool nuget:?package=ContextMenuContainer&version=1.3.1
                    
Install as a Cake Tool

ContextMenuContainer

NuGet Package nuget Paypal

Native Context Menu for .NET MAUI

Add native context menus to any view in your .NET MAUI application. Supports all major platforms: Windows, Android, iOS, macOS

Platform Preview

iOS Android macOS Windows
iOS Android Mac UWP

Installation

dotnet add package ContextMenuContainer

Or via NuGet Package Manager.

Setup

  1. Initialize the component in your MauiProgram.cs by adding the extension method:
using APES.MAUI;

var builder = MauiApp.CreateBuilder();
builder
    .UseMauiApp<App>()
    // Add this line to configure the context menu container
    .ConfigureContextMenuContainer();
  1. Add the namespace to your XAML file:
xmlns:apes="http://apes.ge"

Basic Usage

Wrap any view with the ContextMenuContainer and define your context menu items:

Inline 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>

Binding menu items from ViewModel:

<apes:ContextMenuContainer MenuItems="{Binding ContextMenuItems}">
    <apes:ContextMenuContainer.Content>
        <Frame>
            <Image Source="{Binding ImageSource}"/>
        </Frame>
    </apes:ContextMenuContainer.Content>
</apes:ContextMenuContainer>

ContextMenuItem Properties

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

Icons

To use icons in your context menu items:

  1. Add platform-specific image assets to the appropriate folders
  2. Bind to a FileImageSource from your ViewModel

SVG format is recommended for best cross-platform support.

Known Issues

  • With Xamarin.Forms when used in a CollectionView or ListView item template, there may be conflicts with the collection's own tap/selection events. Consider using TapGestureRecognizer directly in these scenarios.

Roadmap

  • 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

Development & Contribution

Versioning and Releases

This project uses GitVersion for automatic versioning based on Git history and tags.

How to bump version for a new release:
  1. Tag-based versioning: Create a Git tag with the format v{major}.{minor}.{patch} to specify the exact version

    git tag v1.2.0
    git push origin v1.2.0
    
  2. Commit message-based versioning: Include specific keywords in your commit message to trigger version increments

    • Major version bump: +semver:breaking or +semver:major
    • Minor version bump: +semver:feature or +semver:minor
    • Patch version bump: +semver:fix or +semver:patch
  3. Branch-based versioning: The versioning behavior depends on the branch:

    • main branch: Patch increments, creates release versions
    • develop branch: Minor increments with alpha suffix
    • release/* branch: No increment with beta suffix
    • feature/* branch: Inherits version with branch name suffix
    • hotfix/* branch: Patch increment with beta suffix

Contribution Process

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes with appropriate version bump keywords if needed
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Support Development

If this plugin saves you development time, please consider supporting its continued improvement:

Paypal

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows10.0.19041 is compatible.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on ContextMenuContainer:

Repository Stars
securefolderfs-community/SecureFolderFS
Powerful, secure, modern way to keep your files protected.
Version Downloads Last Updated
1.3.1 41 7/3/2025
1.2.3 903 2/11/2024
1.0.8 1,078 12/9/2021
1.0.7 641 6/14/2021
1.0.6 422 6/10/2021
1.0.5 418 6/7/2021
1.0.3 449 6/2/2021
1.0.2 409 5/26/2021
1.0.1 420 5/9/2021
1.0.0 390 4/26/2021

Added MAUI targets