IEnumerable <UITableViewCell> GetOptionsCells() { yield return(sizeCell = new StringSelectionCell(View) { Text = "Size", Items = sizeOptions.Select(x => x.Description), DetailText = CurrentProduct.Size.Description, SelectionChanged = () => { var size = sizeOptions [sizeCell.SelectedIndex]; CurrentProduct.Size = size; } }); yield return(colorCell = new StringSelectionCell(View) { Text = "Color", Items = colorOptions.Select(x => x.Name), DetailText = CurrentProduct.Color.Name, SelectionChanged = () => { var color = colorOptions [colorCell.SelectedIndex]; CurrentProduct.Color = color; }, }); }
IEnumerable<UITableViewCell> GetOptionsCells () { yield return sizeCell = new StringSelectionCell (View) { Text = "Size", Items = sizeOptions.Select (x => x.Description), DetailText = CurrentProduct.Size.Description, SelectionChanged = () => { var size = sizeOptions [sizeCell.SelectedIndex]; CurrentProduct.Size = size; } }; yield return colorCell = new StringSelectionCell (View) { Text = "Color", Items = colorOptions.Select (x => x.Name), DetailText = CurrentProduct.Color.Name, SelectionChanged = () => { var color = colorOptions [colorCell.SelectedIndex]; CurrentProduct.Color = color; }, }; }