maui
maui copied to clipboard
Convert all uses of UICommand to UIAction
Description
Currently for Menu's on Catalyst we are using UICommand's which requires selectors. This leads to a lot of awkward extra code. It appears that we can just use UIAction instead.
One thing I'm not sure of is that with the selector stuff and UICommand, it might be easier to integrate with the default MacOS menus that nearly every app has, like File/Edit/View. I'm not sure if that works with UIAction. Definitely something to consider.
I did a basic test just plopping in UIAction instead of UICommand and it seems like it works
AFAICT the only difference between the two is that one uses a closure and the other uses a selector
Still haven't found anything indicating the why of doing one vs the other.
The one advantage I could see with UICommand is that the actions all execute through the MauiAppDelegate menu override so in theory a user could hook into that for every menu item even ones they've added