ContextMenuMHD 1.4.6
dotnet add package ContextMenuMHD --version 1.4.6
NuGet\Install-Package ContextMenuMHD -Version 1.4.6
<PackageReference Include="ContextMenuMHD" Version="1.4.6" />
<PackageVersion Include="ContextMenuMHD" Version="1.4.6" />
<PackageReference Include="ContextMenuMHD" />
paket add ContextMenuMHD --version 1.4.6
#r "nuget: ContextMenuMHD, 1.4.6"
#:package ContextMenuMHD@1.4.6
#addin nuget:?package=ContextMenuMHD&version=1.4.6
#tool nuget:?package=ContextMenuMHD&version=1.4.6
๐ฆ ContextMenuMHD
ContextMenuMHD is a Blazor Web App component that enables custom right-click context menus with full flexibility and styling.
Developed specifically for .NET 9, this package provides a seamless way to add interactive context menus to your components.
๐ Features
- Fully compatible with .NET 9
- Works with both WebAssembly and Server Blazor
- Simple setup and usage
- Customizable menu items and click actions
๐ฆ Installation
Install the package via NuGet:
dotnet add package ContextMenuMHD
โ๏ธ Setup
Add the JavaScript and CSS references to your wwwroot/index.html (for Blazor WASM) or Pages/_Host.cshtml / App.razor (for Blazor Server):
<script src="_content/ContextMenuMHD/scripts/contextMenuMHD.js"></script>
<link href="_content/ContextMenuMHD/css/contextMenuMHD.css" rel="stylesheet" />
๐งช Usage Example
๐ In your Razor component:
<ContextMenu ElementId="menu2" Options="@Options2">
<div style="padding:10px; border:1px solid gray;">
Click right here
</div>
</ContextMenu>
๐ In your C# code:
List<MenuItem>? Options2;
protected override void OnInitialized()
{
Options2 = new List<MenuItem>
{
new MenuItem { Label = "Opation 1", OnClick = () => logs("Hello 1"), IsEnabled = false },
new MenuItem { Label = "Opation 2", OnClick = () => logs(1) }
};
}
๐ Requirements
- .NET 9.0
- Blazor Web App project
๐ License
This package is free and open source, licensed under the MIT License.
๐ค Contribution & Support
Feel free to open an issue or contribute via pull requests on GitHub. Feedback is always welcome!
๐ซ Author
Created with โค๏ธ by Mohamad Ataya
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.