I'm trying to validate menu items (i.e. enable / disable them) in my Xamarin Mac project but I cannot get my validateMenuItem method to be called:
[Export("validateMenuItem")]
public bool validateMenuItem(NSMenuItem menuItem)
{
// logic to enable / disable goes here...
// default to true
return true;
}
I have placed this method in MainController.cs, MainWindow.cs and AppDelegate.cs. The menu Actions are defined in AppDelegate.h. Auto Enables Items is set to true. The Mac Developer library says "the object implementing this method (validateMenuItem) must be the target of menuItem". The menu actions all work fine. I must be doing something wrong...but what? I'd appreciate any help.
-Bill