diff options
author | CartBlanche <savagesoftware@gmail.com> | 2019-06-20 12:51:55 +0300 |
---|---|---|
committer | CartBlanche <savagesoftware@gmail.com> | 2019-06-20 12:51:55 +0300 |
commit | 6ef99516182a903b5aaeeeca486e706695293d41 (patch) | |
tree | ef3b6fb7c3db69c49b44ac1a0b966781770648ae /Xamarin.PropertyEditing.Mac | |
parent | fd8c56278e746c9bba04a66e78bfe33d1d2e0307 (diff) |
[Mac] Sharable ModalWindowCloseDelegate. For Bindings and Variations to begin with.
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); + } + } +} |