private void OnCanceled(object o, EventArgs e)
 {
     ModalResponse = NSModalResponse.Cancel;
     CloseWindow();
 }
 private void OnOked(object o, EventArgs e)
 {
     ModalResponse = NSModalResponse.OK;
     CloseWindow();
 }
 private void OnCanceled()
 {
     ModalResponse = NSModalResponse.Cancel;
     this.collectionEditor.ViewModel = null;
     Close();
 }
            public override void WillClose(NSNotification notification)
            {
                NSModalResponse response = ((CollectionEditorWindow)notification.Object).ModalResponse;

                NSApplication.SharedApplication.StopModalWithCode((int)response);
            }
 private void OnOked()
 {
     ModalResponse = NSModalResponse.OK;
     this.collectionEditor.ViewModel = null;
     Close();
 }