summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS/Renderers
diff options
context:
space:
mode:
authorkingces95 <kingces95@users.noreply.github.com>2017-03-07 19:56:24 (GMT)
committerGitHub <noreply@github.com>2017-03-07 19:56:24 (GMT)
commite6d5186c8acbf37b877c7ca3c77a378352a3743d (patch)
treed61ca8ea619f7844e9e0a973dbd7bac794e39147 /Xamarin.Forms.Platform.iOS/Renderers
parent2b92142ab2a501de71d3572efc0e5deb2b7bae9a (diff)
downloadxamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.zip
xamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.tar.gz
xamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.tar.bz2
Remove InternalsVisibleTo from Core to XF.Platforms.* (#782)
* Remove InternalsVisibleTo from Core to XF.Platforms.* * Changes per Jason's code review * Move LockableObservableListWrapper to internals namespace * Changes per Stephane's code review * update docs * Touch code to get CI to run tests * Rebase; Update documentation
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Renderers')
-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
10 files changed, 30 insertions, 18 deletions
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;
}