public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { //[Take Row] MealTWCell cell = tableView.CellAt(indexPath) as MealTWCell; if (cell != null && cell.m_bWasChanged) { BasketMealsRecord bmr; if (cell.m_bChecked) { bmr = new BasketMealsRecord(); bmr.RecipeMealsID = m_tableItems[indexPath.Row].m_RecMealID; BasketManager.SaveBasketRecord(bmr); } else { bmr = BasketManager.GetBasketRecipeRecord(m_tableItems[indexPath.Row].m_RecMealID); if (bmr != null) { BasketManager.DeleteBasketRecord(bmr.ID); } } cell.m_bWasChanged = false; } tableView.DeselectRow(indexPath, false); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var views = NSBundle.MainBundle.LoadNib("MealTWCell_iPhone", tableView, null); MealTWCell cell = Runtime.GetNSObject(views.ValueAt(0)) as MealTWCell; cell.m_bChecked = m_tableItems[indexPath.Row].m_bInBasket; cell.m_bGrayBackgnd = indexPath.Row % 2 == 0 ? true : false; cell.update(indexPath.Row); cell.UpdateCell(m_tableItems[indexPath.Row].m_meal.Name, m_tableItems[indexPath.Row].m_qty.ToString(), m_tableItems[indexPath.Row].m_meal.MealDesc); return(cell); }