summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS/Controls/FormsPageControllerDelegate.cs
blob: 5fb7455c82722ab42b00512c3cf5268b30ab71e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
´╗┐using System;
using AppKit;
using Foundation;

namespace Xamarin.Forms.Platform.MacOS
{
	internal class FormsPageControllerDelegate : NSPageControllerDelegate
	{
		readonly Func<NSObject, string> _getIdentifier;
		readonly Func<string, NSViewController> _getViewController;

		public FormsPageControllerDelegate(Func<NSObject, string> getIdentifier,
			Func<string, NSViewController> getViewController)
		{
			_getIdentifier = getIdentifier;
			_getViewController = getViewController;
		}

		public override NSViewController GetViewController(NSPageController pageController, string identifier)
		{
			return _getViewController(identifier);
		}

		public override string GetIdentifier(NSPageController pv, NSObject obj)
		{
			return _getIdentifier(obj);
		}
	}
}