Skip to content

Implemented context menu separators#24

Open
d2dyno1 wants to merge 2 commits intoanpin:mainfrom
d2dyno1:d2dyno/separators
Open

Implemented context menu separators#24
d2dyno1 wants to merge 2 commits intoanpin:mainfrom
d2dyno1:d2dyno/separators

Conversation

@d2dyno1
Copy link

@d2dyno1 d2dyno1 commented Feb 16, 2026

This PR adds context menu separators on all platforms.

  • Added separators for Android, iOS, macOS, and Windows
  • On Android SDK < 28, a button option appears with text content set to underline characters to simulate a separator
  • Upgraded to .NET 10
  • Added BaseContextMenuItem base for ContextMenuItem and ContextMenuSeparator which will make it easier to extend in the future
  • Changed some != null and == null to is not null and is null
  • Changed new UIImage(contextItem.Icon.File) to UIImage.FromBundle(contextItem.Icon.File)
  • Bumped iOS/MacCatalyst minimum version from 14.0 to 15.0
  • Improved code formatting in some places

iOS

Screenshot 2026-02-16 at 22 24 40

MacOS

Screenshot 2026-02-16 at 22 26 02

Android

SDK >= 28
Screenshot 2026-02-16 at 22 46 05

SDK < 28
Screenshot 2026-02-16 at 22 21 29

Windows

No screenshots. The code should be working anyway.

@d2dyno1
Copy link
Author

d2dyno1 commented Feb 16, 2026

I'd need some help from you. I didn't write tests for my changes, nor have I run any existing ones. Could you do that? Also, I need your opinion on the Android SDK < 28 implementation - alternatively, the separator could be completely ignored in this case. Personally, I think Android 5 (SDK 21) is quite old now, and should be removed. What do you think?

@anpin

@anpin
Copy link
Owner

anpin commented Feb 17, 2026

Hi @d2dyno1 thanks for your contribution! I do not have the availability to look into this in the coming weeks as I'm in the process of moving. I approved tests to run in CI.

@d2dyno1
Copy link
Author

d2dyno1 commented Feb 18, 2026

Looks like the build failed with missing workloads:

Error: C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-tizen [D:\a\ContextMenuContainer\ContextMenuContainer\src\APES.MAUI.csproj::TargetFramework=net10.0]
Error: C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [D:\a\ContextMenuContainer\ContextMenuContainer\src\APES.MAUI.csproj::TargetFramework=net10.0]

I'm leaving it as it is now. Besides the tests and this error, the PR looks ready to merge. Please give it a check when you're free again 🙂

@anpin
Copy link
Owner

anpin commented Feb 25, 2026

@d2dyno1 given the screenshots in this PR is this still relevant?

#23

@d2dyno1
Copy link
Author

d2dyno1 commented Feb 25, 2026

Yes. #23 is specific to context menus in a CollectionView item templates, so it still applies

@anpin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants