diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/ModalWindowCloseDelegate.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ModalWindowCloseDelegate.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ModalWindowCloseDelegate.cs new file mode 100644 index 0000000..df2506f --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ModalWindowCloseDelegate.cs @@ -0,0 +1,16 @@ +using System; +using AppKit; +using Foundation; + +namespace Xamarin.PropertyEditing.Mac +{ + internal class ModalWindowCloseDelegate : NSWindowDelegate + { + public NSModalResponse Response { get; set; } = NSModalResponse.Cancel; + + public override void WillClose (NSNotification notification) + { + NSApplication.SharedApplication.StopModalWithCode ((int)Response); + } + } +} |