summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS/Controls/FormsPageControllerDelegate.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.MacOS/Controls/FormsPageControllerDelegate.cs')
-rw-r--r--Xamarin.Forms.Platform.MacOS/Controls/FormsPageControllerDelegate.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/Controls/FormsPageControllerDelegate.cs b/Xamarin.Forms.Platform.MacOS/Controls/FormsPageControllerDelegate.cs
new file mode 100644
index 0000000..5fb7455
--- /dev/null
+++ b/Xamarin.Forms.Platform.MacOS/Controls/FormsPageControllerDelegate.cs
@@ -0,0 +1,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);
+ }
+ }
+} \ No newline at end of file