public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { CatalogCell selectedCell = (CatalogCell)tableView.CellAt(indexPath); var product = _sales[indexPath.Section].ProductsOnSale[indexPath.Row]; WorkerDelegate.PushToProductDetail(product); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { Product product = _sales[indexPath.Section].ProductsOnSale[indexPath.Row]; if (!(tableView.DequeueReusableCell(cellIdentifier, indexPath) is CatalogCell cell)) { cell = new CatalogCell(); } var favoriteProduct = _favoriteProducts.FirstOrDefault(p => p.Id == product.Id); if (favoriteProduct != null) { product.IsFavorite = favoriteProduct.IsFavorite; } cell._workerDelegate = new WeakReference <ICatalogDelegate>(_catalogViewControllerReference); cell.UpdateCell(product); return(cell); }