public AddLocationTableViewSource(List <Location> items, AddLocationViewController tvc) { TableItems = items; viewModel = new LocationsViewLocationViewModel(items.ToArray()); addLocationViewController = tvc; }
public void UpdateCell(LocationsViewLocationViewModel viewModel, NSIndexPath indexPath, NSString cellId) { TableViewCellId = cellId; var section = indexPath.Section; var row = indexPath.Row; if (TableViewCellId == LocationsCellId) { switch (section) { case (int)LocationsSection.current: mainLabel.Text = viewModel.MyLocationName(); secondaryLabel.Text = viewModel.MyLocationAsString(); break; case (int)LocationsSection.favorite: mainLabel.Text = viewModel.LocationName(row+1); secondaryLabel.Text = string.Empty; break; } } else { throw new Exception("unexpected Table View Cell ID"); } }
public void UpdateCell(LocationsViewLocationViewModel viewModel, NSIndexPath indexPath, NSString cellId) { TableViewCellId = cellId; var section = indexPath.Section; var row = indexPath.Row; if (TableViewCellId == AddLocationCellId) { mainLabel.Text = viewModel.LocationName(row); secondaryLabel.Text = ""; } else { throw new Exception("unexpected Table View Cell ID"); } }
public LocationsTableViewSource(List <Location> items, LocationsViewController uivc) { viewModel = new LocationsViewLocationViewModel(items.ToArray()); locationsViewController = uivc; TableItems = items; }