Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AutoClosePopOver.cs « Custom « Controls « Xamarin.PropertyEditing.Mac - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2c2355fbd5cf93df037f1a4fb8d50aa3cab42aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using AppKit;

namespace Xamarin.PropertyEditing.Mac
{
	public class AutoClosePopOver : NSPopover
	{
		public AutoClosePopOver () : base ()
		{
			Behavior = NSPopoverBehavior.Semitransient;
		}

		public override void KeyUp (NSEvent theEvent)
		{
			// If Enter Kit, close the pop-up
			if (theEvent.KeyCode == 36) {
				this.Close ();
			}
		}
	}
}