summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Deserializer.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/EventTracker.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/Extensions/ArrayExtensions.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/Extensions/Extensions.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/Forms.cs12
-rw-r--r--Xamarin.Forms.Platform.iOS/FormsApplicationDelegate.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/NativeBindingService.cs3
-rw-r--r--Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs5
-rw-r--r--Xamarin.Forms.Platform.iOS/Platform.cs3
-rw-r--r--Xamarin.Forms.Platform.iOS/RendererPool.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs26
-rw-r--r--Xamarin.Forms.Platform.iOS/ResourcesProvider.cs3
-rw-r--r--Xamarin.Forms.Platform.iOS/ViewRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.iOS/VisualElementTracker.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/iOSAppLinks.cs2
29 files changed, 63 insertions, 37 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs b/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
index b42f69f..2c0ffb4 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
@@ -47,7 +47,7 @@ namespace Xamarin.Forms.Platform.iOS
{
var id = cell.GetType().FullName;
- var renderer = (CellRenderer)Registrar.Registered.GetHandler(cell.GetType());
+ var renderer = (CellRenderer)Internals.Registrar.Registered.GetHandler<IRegisterable>(cell.GetType());
ContextActionsCell contextCell = null;
UITableViewCell reusableCell = null;
diff --git a/Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs
index 38aae37..d78a163 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs
@@ -39,7 +39,7 @@ namespace Xamarin.Forms.Platform.iOS
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)
{
UIImage uiimage;
try
diff --git a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
index 697608f..3957feb 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
@@ -167,7 +167,7 @@ namespace Xamarin.Forms.Platform.iOS
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 Platform.DefaultRenderer && type == null))
renderer.SetElement(_viewCell.View);
else
diff --git a/Xamarin.Forms.Platform.iOS/Deserializer.cs b/Xamarin.Forms.Platform.iOS/Deserializer.cs
index dcef049..5fc19f4 100644
--- a/Xamarin.Forms.Platform.iOS/Deserializer.cs
+++ b/Xamarin.Forms.Platform.iOS/Deserializer.cs
@@ -5,6 +5,7 @@ using System.IO.IsolatedStorage;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using System.Xml;
+using Xamarin.Forms.Internals;
#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
diff --git a/Xamarin.Forms.Platform.iOS/EventTracker.cs b/Xamarin.Forms.Platform.iOS/EventTracker.cs
index 596506a..8fe1d1d 100644
--- a/Xamarin.Forms.Platform.iOS/EventTracker.cs
+++ b/Xamarin.Forms.Platform.iOS/EventTracker.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
+using Xamarin.Forms.Internals;
#if __MOBILE__
using UIKit;
diff --git a/Xamarin.Forms.Platform.iOS/Extensions/ArrayExtensions.cs b/Xamarin.Forms.Platform.iOS/Extensions/ArrayExtensions.cs
index 9adafec..ac77008 100644
--- a/Xamarin.Forms.Platform.iOS/Extensions/ArrayExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Extensions/ArrayExtensions.cs
@@ -1,4 +1,5 @@
using System;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.iOS
{
diff --git a/Xamarin.Forms.Platform.iOS/Extensions/Extensions.cs b/Xamarin.Forms.Platform.iOS/Extensions/Extensions.cs
index 3b24c1a..1aa4d36 100644
--- a/Xamarin.Forms.Platform.iOS/Extensions/Extensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Extensions/Extensions.cs
@@ -1,4 +1,5 @@
using UIKit;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.iOS
{
diff --git a/Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs b/Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs
index 8248af1..a641972 100644
--- a/Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using static System.String;
+using Xamarin.Forms.Internals;
#if __MOBILE__
using UIKit;
namespace Xamarin.Forms.Platform.iOS
diff --git a/Xamarin.Forms.Platform.iOS/Forms.cs b/Xamarin.Forms.Platform.iOS/Forms.cs
index d658962..f2ba923 100644
--- a/Xamarin.Forms.Platform.iOS/Forms.cs
+++ b/Xamarin.Forms.Platform.iOS/Forms.cs
@@ -71,19 +71,19 @@ namespace Xamarin.Forms
if (IsInitialized)
return;
IsInitialized = true;
- Color.Accent = Color.FromRgba(50, 79, 133, 255);
+ Color.SetAccent(Color.FromRgba(50, 79, 133, 255));
Log.Listeners.Add(new DelegateLogListener((c, m) => Trace.WriteLine(m, c)));
#if __MOBILE__
- Device.Idiom = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? TargetIdiom.Tablet : TargetIdiom.Phone;
+ Device.SetIdiom(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? TargetIdiom.Tablet : TargetIdiom.Phone);
#else
- Device.Idiom = TargetIdiom.Desktop;
+ Device.SetIdiom(TargetIdiom.Desktop);
#endif
Device.PlatformServices = new IOSPlatformServices();
Device.Info = new IOSDeviceInfo();
- Registrar.RegisterAll(new[]
+ Internals.Registrar.RegisterAll(new[]
{ typeof(ExportRendererAttribute), typeof(ExportCellAttribute), typeof(ExportImageSourceHandlerAttribute) });
ExpressionSearch.Default = new iOSExpressionSearch();
}
@@ -306,13 +306,13 @@ namespace Xamarin.Forms
return Task.FromResult(_isolatedStorageFile.GetLastWriteTime(path));
}
- public Task<Stream> OpenFileAsync(string path, FileMode mode, FileAccess access)
+ public Task<Stream> OpenFileAsync(string path, Internals.FileMode mode, Internals.FileAccess access)
{
Stream stream = _isolatedStorageFile.OpenFile(path, (System.IO.FileMode)mode, (System.IO.FileAccess)access);
return Task.FromResult(stream);
}
- public Task<Stream> OpenFileAsync(string path, FileMode mode, FileAccess access, FileShare share)
+ public Task<Stream> OpenFileAsync(string path, Internals.FileMode mode, Internals.FileAccess access, Internals.FileShare share)
{
Stream stream = _isolatedStorageFile.OpenFile(path, (System.IO.FileMode)mode, (System.IO.FileAccess)access,
(System.IO.FileShare)share);
diff --git a/Xamarin.Forms.Platform.iOS/FormsApplicationDelegate.cs b/Xamarin.Forms.Platform.iOS/FormsApplicationDelegate.cs
index da51718..a4ffd89 100644
--- a/Xamarin.Forms.Platform.iOS/FormsApplicationDelegate.cs
+++ b/Xamarin.Forms.Platform.iOS/FormsApplicationDelegate.cs
@@ -117,7 +117,7 @@ namespace Xamarin.Forms.Platform.iOS
if (application == null)
throw new ArgumentNullException("application");
- Application.Current = application;
+ Application.SetCurrentApplication(application);
_application = application;
(application as IApplicationController)?.SetAppIndexingProvider(new IOSAppIndexingProvider());
diff --git a/Xamarin.Forms.Platform.iOS/NativeBindingService.cs b/Xamarin.Forms.Platform.iOS/NativeBindingService.cs
index 3756e2f..b19fdb1 100644
--- a/Xamarin.Forms.Platform.iOS/NativeBindingService.cs
+++ b/Xamarin.Forms.Platform.iOS/NativeBindingService.cs
@@ -1,11 +1,12 @@
using System;
using UIKit;
+using Xamarin.Forms.Xaml.Internals;
[assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.iOS.NativeBindingService))]
namespace Xamarin.Forms.Platform.iOS
{
- class NativeBindingService : Xaml.INativeBindingService
+ class NativeBindingService : INativeBindingService
{
public bool TrySetBinding(object target, string propertyName, BindingBase binding)
{
diff --git a/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs b/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs
index acdd652..d2ead78 100644
--- a/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs
+++ b/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs
@@ -1,6 +1,9 @@
´╗┐using System;
+using Xamarin.Forms.Xaml.Internals;
+using Xamarin.Forms.Internals;
#if __MOBILE__
using UIKit;
+
[assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.iOS.NativeValueConverterService))]
namespace Xamarin.Forms.Platform.iOS
#else
@@ -11,7 +14,7 @@ using UIView = AppKit.NSView;
namespace Xamarin.Forms.Platform.MacOS
#endif
{
- class NativeValueConverterService : Xaml.INativeValueConverterService
+ class NativeValueConverterService : INativeValueConverterService
{
public bool ConvertTo(object value, Type toType, out object nativeValue)
{
diff --git a/Xamarin.Forms.Platform.iOS/Platform.cs b/Xamarin.Forms.Platform.iOS/Platform.cs
index 586892f..a629d67 100644
--- a/Xamarin.Forms.Platform.iOS/Platform.cs
+++ b/Xamarin.Forms.Platform.iOS/Platform.cs
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Foundation;
using UIKit;
using RectangleF = CoreGraphics.CGRect;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.iOS
{
@@ -188,7 +189,7 @@ namespace Xamarin.Forms.Platform.iOS
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.iOS/RendererPool.cs b/Xamarin.Forms.Platform.iOS/RendererPool.cs
index 38fe3c0..7c7e445 100644
--- a/Xamarin.Forms.Platform.iOS/RendererPool.cs
+++ b/Xamarin.Forms.Platform.iOS/RendererPool.cs
@@ -34,7 +34,7 @@ namespace Xamarin.Forms.Platform.MacOS
if (view == null)
throw new ArgumentNullException("view");
- var rendererType = Registrar.Registered.GetHandlerType(view.GetType()) ?? typeof(ViewRenderer);
+ var rendererType = Internals.Registrar.Registered.GetHandlerType(view.GetType()) ?? typeof(ViewRenderer);
Stack<IVisualElementRenderer> renderers;
if (!_freeRenderers.TryGetValue(rendererType, out renderers) || renderers.Count == 0)
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
index 5eb9b77..dbdcb24 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
@@ -137,7 +137,7 @@ namespace Xamarin.Forms.Platform.iOS
{
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)
{
UIImage uiimage;
try
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs b/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
index ba8acbe..2ddd11c 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
@@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Xamarin.Forms;
+using Xamarin.Forms.Internals;
#if __MOBILE__
using UIKit;
namespace Xamarin.Forms.Platform.iOS
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs b/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
index 825a20b..446cc95 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
@@ -1,6 +1,8 @@
using Foundation;
+using Xamarin.Forms.Internals;
#if __MOBILE__
using UIKit;
+
namespace Xamarin.Forms.Platform.iOS
#else
using AppKit;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
index 6f6392b..760a714 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
@@ -108,7 +108,7 @@ namespace Xamarin.Forms.Platform.iOS
((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)
{
UIImage uiimage;
try
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
index be95731..b4333c6 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
@@ -403,7 +403,7 @@ namespace Xamarin.Forms.Platform.iOS
if (_footerRenderer != null)
{
_footerRenderer.Element.MeasureInvalidated -= OnFooterMeasureInvalidated;
- if (footer != null && _footerRenderer.GetType() == Registrar.Registered.GetHandlerType(footer.GetType()))
+ if (footer != null && _footerRenderer.GetType() == Internals.Registrar.Registered.GetHandlerType(footer.GetType()))
{
_footerRenderer.SetElement(footerView);
return;
@@ -449,7 +449,7 @@ namespace Xamarin.Forms.Platform.iOS
if (_headerRenderer != null)
{
_headerRenderer.Element.MeasureInvalidated -= OnHeaderMeasureInvalidated;
- if (header != null && _headerRenderer.GetType() == Registrar.Registered.GetHandlerType(header.GetType()))
+ if (header != null && _headerRenderer.GetType() == Internals.Registrar.Registered.GetHandlerType(header.GetType()))
{
_headerRenderer.SetElement(headerView);
return;
@@ -839,7 +839,7 @@ namespace Xamarin.Forms.Platform.iOS
if (cell.HasContextActions)
throw new NotSupportedException("Header cells do not support context actions");
- var renderer = (CellRenderer)Registrar.Registered.GetHandler(cell.GetType());
+ var renderer = (CellRenderer)Internals.Registrar.Registered.GetHandler<IRegisterable>(cell.GetType());
var view = new HeaderWrapperView();
view.AddSubview(renderer.GetCell(cell, null, tableView));
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs
index 2ea8a00..11a8558 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs
@@ -4,6 +4,7 @@ using Foundation;
using UIKit;
using RectangleF = CoreGraphics.CGRect;
using SizeF = CoreGraphics.CGSize;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.iOS
{
@@ -109,6 +110,8 @@ namespace Xamarin.Forms.Platform.iOS
_menu = menu;
}
+ INavigationMenuController MenuController => _menu;
+
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
{
var cell = (NavigationCell)collectionView.DequeueReusableCell(new NSString("NavigationCell"), indexPath);
@@ -118,7 +121,7 @@ namespace Xamarin.Forms.Platform.iOS
{
cell.Name = target.Title;
cell.Icon = target.Icon;
- cell.Selected = () => _menu.SendTargetSelected(target);
+ cell.Selected = () => MenuController.SendTargetSelected(target);
}
else
{
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs
index 1c7730e..2b702fd 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using Xamarin.Forms.Internals;
using UIKit;
using PageUIStatusBarAnimation = Xamarin.Forms.PlatformConfiguration.iOSSpecific.UIStatusBarAnimation;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs
index c9c24ad..244edfa 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
+using Xamarin.Forms.Internals;
using UIKit;
using PointF = CoreGraphics.CGPoint;
using RectangleF = CoreGraphics.CGRect;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs
index b8a6fc9..060b9d2 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs
@@ -58,7 +58,7 @@ namespace Xamarin.Forms.Platform.iOS
{
var reusable = tableView.DequeueReusableCell(result.GetType().FullName);
- var cellRenderer = Registrar.Registered.GetHandler<CellRenderer>(result.GetType());
+ var cellRenderer = Internals.Registrar.Registered.GetHandler<CellRenderer>(result.GetType());
return cellRenderer.GetCell(result, reusable, Table);
}
return null;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs
index 390e16d..c54c0c9 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs
@@ -20,6 +20,8 @@ namespace Xamarin.Forms.Platform.iOS
{
}
+ IWebViewController ElementController => Element as IWebViewController;
+
public VisualElement Element { get; private set; }
public event EventHandler<VisualElementChangedEventArgs> ElementChanged;
@@ -34,9 +36,9 @@ namespace Xamarin.Forms.Platform.iOS
var oldElement = Element;
Element = element;
Element.PropertyChanged += HandlePropertyChanged;
- ((WebView)Element).EvalRequested += OnEvalRequested;
- ((WebView)Element).GoBackRequested += OnGoBackRequested;
- ((WebView)Element).GoForwardRequested += OnGoForwardRequested;
+ ElementController.EvalRequested += OnEvalRequested;
+ ElementController.GoBackRequested += OnGoBackRequested;
+ ElementController.GoForwardRequested += OnGoForwardRequested;
Delegate = new CustomWebViewDelegate(this);
BackgroundColor = UIColor.Clear;
@@ -96,9 +98,9 @@ namespace Xamarin.Forms.Platform.iOS
StopLoading();
Element.PropertyChanged -= HandlePropertyChanged;
- ((WebView)Element).EvalRequested -= OnEvalRequested;
- ((WebView)Element).GoBackRequested -= OnGoBackRequested;
- ((WebView)Element).GoForwardRequested -= OnGoForwardRequested;
+ ElementController.EvalRequested -= OnEvalRequested;
+ ElementController.GoBackRequested -= OnGoBackRequested;
+ ElementController.GoForwardRequested -= OnGoForwardRequested;
_tracker?.Dispose();
_packager?.Dispose();
@@ -160,8 +162,8 @@ namespace Xamarin.Forms.Platform.iOS
void UpdateCanGoBackForward()
{
- ((WebView)Element).CanGoBack = CanGoBack;
- ((WebView)Element).CanGoForward = CanGoForward;
+ ElementController.CanGoBack = CanGoBack;
+ ElementController.CanGoForward = CanGoForward;
}
class CustomWebViewDelegate : UIWebViewDelegate
@@ -176,6 +178,8 @@ namespace Xamarin.Forms.Platform.iOS
_renderer = renderer;
}
+ IWebViewController WebViewController => WebView;
+
WebView WebView
{
get { return (WebView)_renderer.Element; }
@@ -184,7 +188,7 @@ namespace Xamarin.Forms.Platform.iOS
public override void LoadFailed(UIWebView webView, NSError error)
{
var url = GetCurrentUrl();
- WebView.SendNavigated(new WebNavigatedEventArgs(_lastEvent, new UrlWebViewSource { Url = url }, url, WebNavigationResult.Failure));
+ WebViewController.SendNavigated(new WebNavigatedEventArgs(_lastEvent, new UrlWebViewSource { Url = url }, url, WebNavigationResult.Failure));
_renderer.UpdateCanGoBackForward();
}
@@ -200,7 +204,7 @@ namespace Xamarin.Forms.Platform.iOS
_renderer._ignoreSourceChanges = false;
var args = new WebNavigatedEventArgs(_lastEvent, WebView.Source, url, WebNavigationResult.Success);
- WebView.SendNavigated(args);
+ WebViewController.SendNavigated(args);
_renderer.UpdateCanGoBackForward();
}
@@ -238,7 +242,7 @@ namespace Xamarin.Forms.Platform.iOS
var lastUrl = request.Url.ToString();
var args = new WebNavigatingEventArgs(navEvent, new UrlWebViewSource { Url = lastUrl }, lastUrl);
- WebView.SendNavigating(args);
+ WebViewController.SendNavigating(args);
_renderer.UpdateCanGoBackForward();
return !args.Cancel;
}
diff --git a/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs b/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
index f02655a..0bccc60 100644
--- a/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
+++ b/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
@@ -1,9 +1,12 @@
#if __MOBILE__
using UIKit;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.iOS
#else
+using Xamarin.Forms.Internals;
+
namespace Xamarin.Forms.Platform.MacOS
#endif
{
diff --git a/Xamarin.Forms.Platform.iOS/ViewRenderer.cs b/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
index 8a433c9..a785fb0 100644
--- a/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
@@ -114,7 +114,7 @@ namespace Xamarin.Forms.Platform.MacOS
protected override void OnRegisterEffect(PlatformEffect effect)
{
base.OnRegisterEffect(effect);
- effect.Control = Control;
+ effect.SetControl(Control);
}
#if __MOBILE__
protected override void SetAccessibilityHint()
diff --git a/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs b/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
index 57c9ab1..3fcb3ff 100644
--- a/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
@@ -105,8 +105,8 @@ namespace Xamarin.Forms.Platform.MacOS
if (platformEffect == null)
return;
- platformEffect.Container = container;
- platformEffect.Control = control;
+ platformEffect.SetContainer(container);
+ platformEffect.SetControl(control);
}
void IEffectControlProvider.RegisterEffect(Effect effect)
@@ -291,7 +291,7 @@ namespace Xamarin.Forms.Platform.MacOS
protected virtual void OnRegisterEffect(PlatformEffect effect)
{
- effect.Container = this;
+ effect.SetContainer(this);
}
#if __MOBILE__
diff --git a/Xamarin.Forms.Platform.iOS/VisualElementTracker.cs b/Xamarin.Forms.Platform.iOS/VisualElementTracker.cs
index 29840e2..205aa1d 100644
--- a/Xamarin.Forms.Platform.iOS/VisualElementTracker.cs
+++ b/Xamarin.Forms.Platform.iOS/VisualElementTracker.cs
@@ -3,6 +3,7 @@ using System.ComponentModel;
using System.Drawing;
using System.Threading;
using CoreAnimation;
+using Xamarin.Forms.Internals;
#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
diff --git a/Xamarin.Forms.Platform.iOS/iOSAppLinks.cs b/Xamarin.Forms.Platform.iOS/iOSAppLinks.cs
index f8771a9..1a5f7c7 100644
--- a/Xamarin.Forms.Platform.iOS/iOSAppLinks.cs
+++ b/Xamarin.Forms.Platform.iOS/iOSAppLinks.cs
@@ -109,7 +109,7 @@ namespace Xamarin.Forms.Platform.iOS
var source = deepLinkUri.Thumbnail;
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)
{
UIImage uiimage;
try