void Initialize() {
Controller.ShowWindowEvent += delegate {
using (var a = new NSAutoreleasePool()) {
InvokeOnMainThread(delegate {
Window.OrderFrontRegardless();
});
}
};
Controller.HideWindowEvent += delegate {
using (var a = new NSAutoreleasePool()) {
InvokeOnMainThread(delegate {
Window.PerformClose(this);
});
}
};
}