{"id":13711164,"url":"https://github.com/anpin/ContextMenuContainer","last_synced_at":"2025-05-06T20:32:12.095Z","repository":{"id":38030580,"uuid":"360236518","full_name":"anpin/ContextMenuContainer","owner":"anpin","description":"Native context menu for any Xamarin.Forms or MAUI view","archived":false,"fork":false,"pushed_at":"2024-03-13T16:24:08.000Z","size":10241,"stargazers_count":50,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-14T00:34:52.710Z","etag":null,"topics":["context-menu","ios","maui","ui-components","uwp","xamarin","xamarin-forms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anpin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-21T16:28:40.000Z","updated_at":"2024-08-03T00:04:08.664Z","dependencies_parsed_at":"2024-08-03T00:04:04.990Z","dependency_job_id":"680d638a-aa9c-497a-a2fe-71f95260b647","html_url":"https://github.com/anpin/ContextMenuContainer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anpin%2FContextMenuContainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anpin%2FContextMenuContainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anpin%2FContextMenuContainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anpin%2FContextMenuContainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anpin","download_url":"https://codeload.github.com/anpin/ContextMenuContainer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224528345,"owners_count":17326348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["context-menu","ios","maui","ui-components","uwp","xamarin","xamarin-forms"],"created_at":"2024-08-02T23:01:05.230Z","updated_at":"2024-11-13T21:31:35.022Z","avatar_url":"https://github.com/anpin.png","language":"C#","funding_links":["https://paypal.me/APEngineeringLLC?locale.x=en_US"],"categories":["UI"],"sub_categories":[],"readme":"# ContextMenuContainer\n[![NuGet](https://img.shields.io/nuget/v/ContextMenuContainer.svg?style=flat)](https://www.nuget.org/packages/ContextMenuContainer/)\n[![Package nuget](https://github.com/anpin/ContextMenuContainer/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/anpin/ContextMenuContainer/actions/workflows/main.yml)\n[![Paypal](https://img.shields.io/badge/Donate%20with-PayPal-blue)](https://paypal.me/APEngineeringLLC?locale.x=en_US)\n\nNative context menu for any MAUI and Xamarin.Forms view. \nSupports Windows, Android, iOS and macOS.\n\niOS | Android | macOs | Windows\n:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:\n![iOS](img/ios.gif) | ![Android](img/android.gif) | ![Mac](img/macos.gif) | ![UWP](img/uwp.png)\n## How to use\n1. Add namespace to your XAML file \n    `xmlns:apes=\"http://apes.ge\"`\n2. Add following line of code to your `App.xaml.cs` in order to preserve component during linking and resolve our namespace schema in XAML\n```\n    APES.UI.XF.ContextMenuContainer.Init();\n```\n3. Extra step for UWP: add our assembly to Xamarin.Forms external assemblies in your UWP `App.xaml.cs` \n```\n    using System.Reflection;\n    ...\n    var extraAssemblies = new List\u003cAssembly\u003e();\n    extraAssemblies.Add(typeof(APES.UI.XF.ContextMenuContainer).GetTypeInfo().Assembly);\n    Xamarin.Forms.Forms.Init(e, extraAssemblies);\n```\n4. Wrap your view with `ContextMenuContainer`, define your context actions inline or bind from your ViewModel\n```\n//Inline\n\u003capes:ContextMenuContainer x:Name=\"ActionsInline\"\u003e\n    \u003capes:ContextMenuContainer.MenuItems\u003e\n        \u003capes:ContextMenuItem Text=\"My action\" \n                Command=\"{Binding MyCommand}\" \n                CommandParameter=\"{Binding .}\" /\u003e\n        \u003capes:ContextMenuItem Text=\"My destructive action\" \n                Command=\"{Binding MyDestructiveCommand}\" \n                CommandParameter=\"{Binding .}\" \n                IsDestructive=\"True\" \n                Icon=\"{Binding DestructiveIconSource}\"/\u003e\n    \u003c/apes:ContextMenuContainer.MenuItems\u003e\n    \u003capes:ContextMenuContainer.Content\u003e\n        \u003cLabel Text=\"Hold me!\"/\u003e\n    \u003c/apes:ContextMenuContainer.Content\u003e\n\u003c/apes:ContextMenuContainer\u003e\n//From binding\n\u003capes:ContextMenuContainer x:Name=\"ContextActionsWithBinding\" \n                            MenuItems=\"{Binding ImageContextItems}\"\u003e\n    \u003capes:ContextMenuContainer.Content\u003e\n        \u003cFrame\u003e\n            \u003cImage Source=\"{Binding IconSource}\"/\u003e\n        \u003c/Frame\u003e\n    \u003c/apes:ContextMenuContainer.Content\u003e\n\u003c/apes:ContextMenuContainer\u003e\n```\n\n## Icons \nCross-platform icons are really messy at this point, but you can put your assets to the coresponding folder on each platform and then bind to a `FileIconImageSource` from your ViewModel. Please refer to the sample folder for example. SVG is preferable.\n## Known issues \n- Using it in a `ViewCell` template of `ListView` might lead to issues with recognizing tap/select events from the list itself, so you might consider using TapGestureRecognizer on the template instead\n\n## To-Do\n- [x] Configure build scripts\n- [ ] Refactor MAUI initialization\n- [ ] Add visibility property \n- [ ] Add highlight property \n- [ ] Add support for shortcuts \n- [ ] Add support of accessability features\n- [ ] Add support for submenus and separators\n- [ ] Add font icons\n- [ ] Cover it all with tests\n\n## If this plugin saves you time please consider donating via buttons below, so I can make it even better\n[![Paypal](https://img.shields.io/badge/Donate%20with-PayPal-blue)](https://paypal.me/APEngineeringLLC?locale.x=en_US)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanpin%2FContextMenuContainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanpin%2FContextMenuContainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanpin%2FContextMenuContainer/lists"}