summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs b/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
new file mode 100644
index 0000000..c0fcae3
--- /dev/null
+++ b/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
@@ -0,0 +1,50 @@
+´╗┐using AppKit;
+
+namespace Xamarin.Forms.Platform.MacOS
+{
+ internal class PlatformRenderer : NSViewController
+ {
+ PlatformNavigation _platformNavigation;
+ bool _disposed;
+
+ internal PlatformRenderer(Platform platform)
+ {
+ Platform = platform;
+ View = new NSView(NSApplication.SharedApplication.Windows[0].Frame);
+ _platformNavigation = new PlatformNavigation(this);
+ }
+
+ public Platform Platform { get; set; }
+
+ public PlatformNavigation Navigation => _platformNavigation;
+
+ public override void ViewDidAppear()
+ {
+ Platform.DidAppear();
+ base.ViewDidAppear();
+ }
+
+ public override void ViewDidLayout()
+ {
+ base.ViewDidLayout();
+ Platform.LayoutSubviews();
+ }
+
+ public override void ViewWillAppear()
+ {
+ Platform.WillAppear();
+ base.ViewWillAppear();
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (!_disposed)
+ {
+ _platformNavigation.Dispose();
+ _platformNavigation = null;
+ }
+ _disposed = true;
+ base.Dispose(disposing);
+ }
+ }
+} \ No newline at end of file