summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS/Cells
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-06-17 03:10:18 -0700
committerRui Marinho <me@ruimarinho.net>2016-06-17 11:10:18 +0100
commit925fc0aa588a060eb23fa16c1d225dd030012c23 (patch)
tree83676c25c29d97d9250516b217020ba85425796d /Xamarin.Forms.Platform.iOS/Cells
parentd44396a4534b1e2bc81143c809e4adaee656ab15 (diff)
downloadxamarin-forms-925fc0aa588a060eb23fa16c1d225dd030012c23.tar.gz
xamarin-forms-925fc0aa588a060eb23fa16c1d225dd030012c23.tar.bz2
xamarin-forms-925fc0aa588a060eb23fa16c1d225dd030012c23.zip
Prep Cell & friends for removal of InternalsVisibleTo (#142)
* Prep Cell & friends for removal of InternalsVisibleTo Includes: - Cell - EntryCell - ListView - MenuItem - TableView - ViewCell - Toolbar Moved extensions to Internal & removed TPH * Update docs * [Controls] Ignore Issue2411 on iOS <9 * [Controls] Formatting for Issue2411
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Cells')
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/CellRenderer.cs7
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs14
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs1
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs12
5 files changed, 24 insertions, 12 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Cells/CellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/CellRenderer.cs
index c01a7774..3ec12bd8 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/CellRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/CellRenderer.cs
@@ -1,4 +1,5 @@
using System;
+using Xamarin.Forms.Internals;
#if __UNIFIED__
using UIKit;
using Foundation;
@@ -32,7 +33,7 @@ namespace Xamarin.Forms.Platform.iOS
protected void UpdateBackground(UITableViewCell tableViewCell, Cell cell)
{
- if (TemplatedItemsList<ItemsView<Cell>, Cell>.GetIsGroupHeader(cell))
+ if (cell.GetIsGroupHeader<ItemsView<Cell>, Cell>())
{
if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
tableViewCell.BackgroundColor = new UIColor(247f / 255f, 247f / 255f, 247f / 255f, 1);
@@ -50,11 +51,11 @@ namespace Xamarin.Forms.Platform.iOS
}
}
- protected void WireUpForceUpdateSizeRequested(Cell cell, UITableViewCell nativeCell, UITableView tableView)
+ protected void WireUpForceUpdateSizeRequested(ICellController cell, UITableViewCell nativeCell, UITableView tableView)
{
cell.ForceUpdateSizeRequested -= _onForceUpdateSizeRequested;
- _onForceUpdateSizeRequested = delegate
+ _onForceUpdateSizeRequested = (sender, e) =>
{
var index = tableView.IndexPathForCell(nativeCell);
if (index != null)
diff --git a/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs b/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
index a9265868..f1a53917 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
+using Xamarin.Forms.Internals;
#if __UNIFIED__
using UIKit;
@@ -27,11 +28,16 @@ namespace Xamarin.Forms.Platform.iOS
if (_cell == value)
return;
- if (_cell != null)
- Device.BeginInvokeOnMainThread(_cell.SendDisappearing);
+ ICellController cellController = _cell;
+
+ if (cellController != null)
+ Device.BeginInvokeOnMainThread(cellController.SendDisappearing);
+
_cell = value;
- if (_cell != null)
- Device.BeginInvokeOnMainThread(_cell.SendAppearing);
+ cellController = value;
+
+ if (cellController != null)
+ Device.BeginInvokeOnMainThread(cellController.SendAppearing);
}
}
diff --git a/Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs
index 1af49b4a..e94e0ea5 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs
@@ -82,7 +82,7 @@ namespace Xamarin.Forms.Platform.iOS
static void OnKeyBoardDoneButtonPressed(object sender, EventArgs e)
{
var cell = (EntryCellTableViewCell)sender;
- var model = (EntryCell)cell.Cell;
+ var model = (IEntryCellController)cell.Cell;
model.SendCompleted();
}
diff --git a/Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs
index ade59e82..010319ba 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs
@@ -1,5 +1,6 @@
using System.ComponentModel;
using System.Threading.Tasks;
+using Xamarin.Forms.Internals;
#if __UNIFIED__
using UIKit;
using Foundation;
diff --git a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
index 9493c8fb..f1cb2fb6 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
@@ -1,6 +1,7 @@
using System;
using System.ComponentModel;
-using System.Diagnostics;
+using Xamarin.Forms.Internals;
+
#if __UNIFIED__
using UIKit;
#else
@@ -145,11 +146,14 @@ namespace Xamarin.Forms.Platform.iOS
void UpdateCell(ViewCell cell)
{
- if (_viewCell != null)
- Device.BeginInvokeOnMainThread(_viewCell.SendDisappearing);
+ ICellController cellController = _viewCell;
+ if (cellController != null)
+ Device.BeginInvokeOnMainThread(cellController.SendDisappearing);
_viewCell = cell;
- Device.BeginInvokeOnMainThread(_viewCell.SendAppearing);
+ cellController = cell;
+
+ Device.BeginInvokeOnMainThread(cellController.SendAppearing);
IVisualElementRenderer renderer;
if (_rendererRef == null || !_rendererRef.TryGetTarget(out renderer))