summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs22
1 files changed, 10 insertions, 12 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs
index 060b9d20..dea20da6 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/TableViewModelRenderer.cs
@@ -9,8 +9,6 @@ namespace Xamarin.Forms.Platform.iOS
{
readonly Dictionary<nint, Cell> _headerCells = new Dictionary<nint, Cell>();
- protected ITableViewController Controller => View;
-
protected bool HasBoundGestures;
protected UITableView Table;
@@ -19,7 +17,7 @@ namespace Xamarin.Forms.Platform.iOS
public TableViewModelRenderer(TableView model)
{
View = model;
- Controller.ModelChanged += (s, e) =>
+ View.ModelChanged += (s, e) =>
{
if (Table != null)
Table.ReloadData();
@@ -31,7 +29,7 @@ namespace Xamarin.Forms.Platform.iOS
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
- var cell = Controller.Model.GetCell(indexPath.Section, indexPath.Row);
+ var cell = View.Model.GetCell(indexPath.Section, indexPath.Row);
var nativeCell = CellTableViewCell.GetNativeCell(tableView, cell);
return nativeCell;
@@ -40,7 +38,7 @@ namespace Xamarin.Forms.Platform.iOS
public override nfloat GetHeightForHeader(UITableView tableView, nint section)
{
if (!_headerCells.ContainsKey((int)section))
- _headerCells[section] = Controller.Model.GetHeaderCell((int)section);
+ _headerCells[section] = View.Model.GetHeaderCell((int)section);
var result = _headerCells[section];
@@ -50,7 +48,7 @@ namespace Xamarin.Forms.Platform.iOS
public override UIView GetViewForHeader(UITableView tableView, nint section)
{
if (!_headerCells.ContainsKey((int)section))
- _headerCells[section] = Controller.Model.GetHeaderCell((int)section);
+ _headerCells[section] = View.Model.GetHeaderCell((int)section);
var result = _headerCells[section];
@@ -71,35 +69,35 @@ namespace Xamarin.Forms.Platform.iOS
if (indexPath == null)
return;
- Controller.Model.RowLongPressed(indexPath.Section, indexPath.Row);
+ View.Model.RowLongPressed(indexPath.Section, indexPath.Row);
}
public override nint NumberOfSections(UITableView tableView)
{
BindGestures(tableView);
- return Controller.Model.GetSectionCount();
+ return View.Model.GetSectionCount();
}
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
- Controller.Model.RowSelected(indexPath.Section, indexPath.Row);
+ View.Model.RowSelected(indexPath.Section, indexPath.Row);
if (AutomaticallyDeselect)
tableView.DeselectRow(indexPath, true);
}
public override nint RowsInSection(UITableView tableview, nint section)
{
- return Controller.Model.GetRowCount((int)section);
+ return View.Model.GetRowCount((int)section);
}
public override string[] SectionIndexTitles(UITableView tableView)
{
- return Controller.Model.GetSectionIndexTitles();
+ return View.Model.GetSectionIndexTitles();
}
public override string TitleForHeader(UITableView tableView, nint section)
{
- return Controller.Model.GetSectionTitle((int)section);
+ return View.Model.GetSectionTitle((int)section);
}
void BindGestures(UITableView tableview)