public override void RunLoop ()
		{
			var application = NSApplication.SharedApplication;

			using (var appDelegate = new SynchronousApplicationDelegate ())
			using (var windowDelegate = new SynchronousWindowDelegate (this)) {
				var savedAppDelegate = application.Delegate;
				var savedWindowDelegate = _mainWindow.Delegate;

				application.Delegate = appDelegate;
				_mainWindow.Delegate = windowDelegate;

				try {
					StartRunLoop ();
					application.Run ();
				} finally {
					application.Delegate = savedAppDelegate;
					_mainWindow.Delegate = savedWindowDelegate;
				}
			}
		}
        public override void RunLoop()
        {
            var application = NSApplication.SharedApplication;

            using (var appDelegate = new SynchronousApplicationDelegate())
                using (var windowDelegate = new SynchronousWindowDelegate(this)) {
                    var savedAppDelegate    = application.Delegate;
                    var savedWindowDelegate = _mainWindow.Delegate;

                    application.Delegate = appDelegate;
                    _mainWindow.Delegate = windowDelegate;

                    try {
                        StartRunLoop();
                        application.Run();
                    } finally {
                        application.Delegate = savedAppDelegate;
                        _mainWindow.Delegate = savedWindowDelegate;
                    }
                }
        }