summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.MacOS')
-rw-r--r--Xamarin.Forms.Platform.MacOS/Cells/CellNSView.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Cells/ImageCellRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Cells/ViewCellNSView.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/FormsApplicationDelegate.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Platform.cs3
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/ButtonRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/ImageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/ListViewDataSource.cs1
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/MasterDetailPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/PageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/TabbedPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/WebViewRenderer.cs22
13 files changed, 24 insertions, 22 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/Cells/CellNSView.cs b/Xamarin.Forms.Platform.MacOS/Cells/CellNSView.cs
index 08043ce..f0a9d0f 100644
--- a/Xamarin.Forms.Platform.MacOS/Cells/CellNSView.cs
+++ b/Xamarin.Forms.Platform.MacOS/Cells/CellNSView.cs
@@ -124,7 +124,7 @@ namespace Xamarin.Forms.Platform.MacOS
NSView nativeCell;
if (reusable == null || !isRecycle)
{
- var renderer = (CellRenderer)Registrar.Registered.GetHandler(cell.GetType());
+ var renderer = (CellRenderer)Internals.Registrar.Registered.GetHandler<IRegisterable>(cell.GetType());
nativeCell = renderer.GetCell(cell, null, tableView);
}
else
diff --git a/Xamarin.Forms.Platform.MacOS/Cells/ImageCellRenderer.cs b/Xamarin.Forms.Platform.MacOS/Cells/ImageCellRenderer.cs
index 8bd7677..1986ebb 100644
--- a/Xamarin.Forms.Platform.MacOS/Cells/ImageCellRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Cells/ImageCellRenderer.cs
@@ -43,7 +43,7 @@ namespace Xamarin.Forms.Platform.MacOS
IImageSourceHandler handler;
- if (source != null && (handler = Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
+ if (source != null && (handler = Internals.Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
{
NSImage uiimage;
try
diff --git a/Xamarin.Forms.Platform.MacOS/Cells/ViewCellNSView.cs b/Xamarin.Forms.Platform.MacOS/Cells/ViewCellNSView.cs
index 6b342c2..f249874 100644
--- a/Xamarin.Forms.Platform.MacOS/Cells/ViewCellNSView.cs
+++ b/Xamarin.Forms.Platform.MacOS/Cells/ViewCellNSView.cs
@@ -92,7 +92,7 @@ namespace Xamarin.Forms.Platform.MacOS
if (renderer.Element != null && renderer == Platform.GetRenderer(renderer.Element))
renderer.Element.ClearValue(Platform.RendererProperty);
- var type = Registrar.Registered.GetHandlerType(_viewCell.View.GetType());
+ var type = Internals.Registrar.Registered.GetHandlerType(_viewCell.View.GetType());
if (renderer.GetType() == type || (renderer is DefaultRenderer && type == null))
renderer.SetElement(_viewCell.View);
else
diff --git a/Xamarin.Forms.Platform.MacOS/FormsApplicationDelegate.cs b/Xamarin.Forms.Platform.MacOS/FormsApplicationDelegate.cs
index 4899698..8411fde 100644
--- a/Xamarin.Forms.Platform.MacOS/FormsApplicationDelegate.cs
+++ b/Xamarin.Forms.Platform.MacOS/FormsApplicationDelegate.cs
@@ -24,7 +24,7 @@ namespace Xamarin.Forms.Platform.MacOS
if (application == null)
throw new ArgumentNullException(nameof(application));
- Application.Current = application;
+ Application.SetCurrentApplication(application);
_application = application;
application.PropertyChanged += ApplicationOnPropertyChanged;
diff --git a/Xamarin.Forms.Platform.MacOS/Platform.cs b/Xamarin.Forms.Platform.MacOS/Platform.cs
index 8629684..74c1e0e 100644
--- a/Xamarin.Forms.Platform.MacOS/Platform.cs
+++ b/Xamarin.Forms.Platform.MacOS/Platform.cs
@@ -2,6 +2,7 @@
using AppKit;
using RectangleF = CoreGraphics.CGRect;
using System.Linq;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.MacOS
{
@@ -95,7 +96,7 @@ namespace Xamarin.Forms.Platform.MacOS
public static IVisualElementRenderer CreateRenderer(VisualElement element)
{
var t = element.GetType();
- var renderer = Registrar.Registered.GetHandler<IVisualElementRenderer>(t) ?? new DefaultRenderer();
+ var renderer = Internals.Registrar.Registered.GetHandler<IVisualElementRenderer>(t) ?? new DefaultRenderer();
renderer.SetElement(element);
return renderer;
}
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/ButtonRenderer.cs
index 05b87fa..b23b422 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/ButtonRenderer.cs
@@ -92,7 +92,7 @@ namespace Xamarin.Forms.Platform.MacOS
{
IImageSourceHandler handler;
FileImageSource source = Element.Image;
- if (source != null && (handler = Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
+ if (source != null && (handler = Internals.Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
{
NSImage uiimage;
try
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/ImageRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/ImageRenderer.cs
index 090df9a..f936f4a 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/ImageRenderer.cs
@@ -83,7 +83,7 @@ namespace Xamarin.Forms.Platform.MacOS
((IImageController)Element).SetIsLoading(true);
- if (source != null && (handler = Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
+ if (source != null && (handler = Internals.Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
{
NSImage uiimage;
try
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/ListViewDataSource.cs b/Xamarin.Forms.Platform.MacOS/Renderers/ListViewDataSource.cs
index 6742053..0a0a9db 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/ListViewDataSource.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/ListViewDataSource.cs
@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using AppKit;
using Foundation;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.MacOS
{
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/MasterDetailPageRenderer.cs
index 8d2fd55..34005c3 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/MasterDetailPageRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/MasterDetailPageRenderer.cs
@@ -19,7 +19,7 @@ namespace Xamarin.Forms.Platform.MacOS
{
var platformEffect = effect as PlatformEffect;
if (platformEffect != null)
- platformEffect.Container = View;
+ platformEffect.SetContainer(View);
}
protected MasterDetailPage MasterDetailPage => _masterDetailPage ?? (_masterDetailPage = (MasterDetailPage)Element);
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs
index 23d7f85..218d787 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs
@@ -28,7 +28,7 @@ namespace Xamarin.Forms.Platform.MacOS
{
var platformEffect = effect as PlatformEffect;
if (platformEffect != null)
- platformEffect.Container = View;
+ platformEffect.SetContainer(View);
}
public NavigationPageRenderer() : this(IntPtr.Zero)
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/PageRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/PageRenderer.cs
index e0845d5..863b2a7 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/PageRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/PageRenderer.cs
@@ -24,7 +24,7 @@ namespace Xamarin.Forms.Platform.MacOS
{
var platformEffect = effect as PlatformEffect;
if (platformEffect != null)
- platformEffect.Container = View;
+ platformEffect.SetContainer(View);
}
public VisualElement Element { get; private set; }
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/TabbedPageRenderer.cs
index 3aee095..e1591be 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/TabbedPageRenderer.cs
@@ -80,7 +80,7 @@ namespace Xamarin.Forms.Platform.MacOS
{
var platformEffect = effect as PlatformEffect;
if (platformEffect != null)
- platformEffect.Container = View;
+ platformEffect.SetContainer(View);
}
public void SetElementSize(Size size)
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/WebViewRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/WebViewRenderer.cs
index 8d93c2c..509c38f 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/WebViewRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/WebViewRenderer.cs
@@ -13,7 +13,7 @@ namespace Xamarin.Forms.Platform.MacOS
WebNavigationEvent _lastBackForwardEvent;
WebNavigationEvent _lastEvent;
- IElementController ElementController => Element;
+ IWebViewController ElementController => Element;
void IWebViewDelegate.LoadHtml(string html, string baseUrl)
{
@@ -43,9 +43,9 @@ namespace Xamarin.Forms.Platform.MacOS
Control.OnFinishedLoading += OnNSWebViewFinishedLoad;
Control.OnFailedLoading += OnNSWebViewFailedLoadWithError;
- Element.EvalRequested += OnEvalRequested;
- Element.GoBackRequested += OnGoBackRequested;
- Element.GoForwardRequested += OnGoForwardRequested;
+ ElementController.EvalRequested += OnEvalRequested;
+ ElementController.GoBackRequested += OnGoBackRequested;
+ ElementController.GoForwardRequested += OnGoForwardRequested;
Layer.BackgroundColor = NSColor.Clear.CGColor;
}
@@ -69,9 +69,9 @@ namespace Xamarin.Forms.Platform.MacOS
_disposed = true;
Control.OnFinishedLoading -= OnNSWebViewFinishedLoad;
Control.OnFailedLoading -= OnNSWebViewFailedLoadWithError;
- Element.EvalRequested -= OnEvalRequested;
- Element.GoBackRequested -= OnGoBackRequested;
- Element.GoForwardRequested -= OnGoForwardRequested;
+ ElementController.EvalRequested -= OnEvalRequested;
+ ElementController.GoBackRequested -= OnGoBackRequested;
+ ElementController.GoForwardRequested -= OnGoForwardRequested;
}
base.Dispose(disposing);
}
@@ -90,8 +90,8 @@ namespace Xamarin.Forms.Platform.MacOS
{
if (Element == null)
return;
- Element.CanGoBack = Control.CanGoBack();
- Element.CanGoForward = Control.CanGoForward();
+ ElementController.CanGoBack = Control.CanGoBack();
+ ElementController.CanGoForward = Control.CanGoForward();
}
void OnEvalRequested(object sender, EvalRequested eventArg)
@@ -124,7 +124,7 @@ namespace Xamarin.Forms.Platform.MacOS
void OnNSWebViewFailedLoadWithError(object sender, WebKit.WebResourceErrorEventArgs e)
{
_lastEvent = _lastBackForwardEvent;
- Element?.SendNavigated(new WebNavigatedEventArgs(_lastEvent, new UrlWebViewSource { Url = Control.MainFrameUrl },
+ ElementController?.SendNavigated(new WebNavigatedEventArgs(_lastEvent, new UrlWebViewSource { Url = Control.MainFrameUrl },
Control.MainFrameUrl, WebNavigationResult.Failure));
UpdateCanGoBackForward();
@@ -140,7 +140,7 @@ namespace Xamarin.Forms.Platform.MacOS
_ignoreSourceChanges = false;
_lastEvent = _lastBackForwardEvent;
- Element?.SendNavigated(new WebNavigatedEventArgs(_lastEvent, Element?.Source, Control.MainFrameUrl,
+ ElementController?.SendNavigated(new WebNavigatedEventArgs(_lastEvent, Element?.Source, Control.MainFrameUrl,
WebNavigationResult.Success));
UpdateCanGoBackForward();