The standard way to do this in MonoMac is to nest a private class inside your MainWindowController that derives from NSPopoverDelegate. Because your delegate has to derive from the base delegate class, you can't really make your MainWindowController itself the delegate.
e.g.
public partial class MainWindowController : MonoMac.AppKit.NSWindowController
{
public override void AwakeFromNib()
{
myPopover.Delegate = new MyPopoverDelegate();
base.AwakeFromNib();
}
private class MyPopoverDelegate : NSPopoverDelegate
{
public override bool ShouldClose(NSPopover popover)
{
// etc...
}
}
If you really want your MainWindowController to function as the delegate, you can use the WeakDelegate
property (which takes an object) and manually export the delegate methods. This is not the preferred pattern:
public override void AwakeFromNib()
{
myPopover.WeakDelegate = this;
base.AwakeFromNib();
}
[Export("popoverShouldClose:")]
private bool PopoverShouldClose(NSPopover popover)
{
// etc...
}