public MacMenuButton(IMenuButtonEventSink eventSink, ApplicationContext context) { this.eventSink = eventSink; this.context = context; Cell = new ColoredPopUpButtonCell(); PullsDown = true; Activated += delegate { context.InvokeUserCode(eventSink.OnClicked); }; NSNotificationCenter.DefaultCenter.AddObserver((NSString)"NSPopUpButtonWillPopUpNotification", CreateMenu, this); AddItem(""); }
public MacMenuButton (IMenuButtonEventSink eventSink, ApplicationContext context) { this.eventSink = eventSink; this.context = context; Cell = new ColoredPopUpButtonCell (); PullsDown = true; Activated += delegate { context.InvokeUserCode (delegate { eventSink.OnClicked (); }); }; NSNotificationCenter.DefaultCenter.AddObserver ((NSString)"NSPopUpButtonWillPopUpNotification", CreateMenu, this); AddItem (""); }