public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { if (_wardrobeList.Count > 0) { TBL_WARDROBE wardrobeItem = _wardrobeList[indexPath.Row]; } }
public void PopulateWardrobe() { DeleteAllFromTblWardrobe(); var row1 = new TBL_WARDROBE { ItemType = "shirt", ItemDesc = "white short-sleeved", Size = "8", LastWorn = Convert.ToDateTime("03/14/2021") }; var row2 = new TBL_WARDROBE { ItemType = "pants", ItemDesc = "navy long dress", Size = "6", LastWorn = Convert.ToDateTime("10/20/2020") }; var row3 = new TBL_WARDROBE { ItemType = "dress", ItemDesc = "green mini-dress", Size = "8", LastWorn = Convert.ToDateTime("01/15/2016") }; var row4 = new TBL_WARDROBE { ItemType = "shirt", ItemDesc = "silk blouse peach", Size = "10", LastWorn = Convert.ToDateTime("03/14/2021") }; var row5 = new TBL_WARDROBE { ItemType = "dress", ItemDesc = "floral tea length", Size = "8", LastWorn = Convert.ToDateTime("06/25/2019") }; var row6 = new TBL_WARDROBE { ItemType = "pants", ItemDesc = "twill shorts", Size = "6", LastWorn = Convert.ToDateTime("04/20/2021") }; using (var db = GetConnectionString()) { db.Insert(row1); db.Insert(row2); db.Insert(row3); db.Insert(row4); db.Insert(row5); db.Insert(row6); } }
public override void Selected(UIPickerView pickerView, nint row, nint component) { wardrobeObj = new TBL_WARDROBE(); int rowNo = (int)pickerView.SelectedRowInComponent(0); string itemTypeStr = itemTypeAry[rowNo]; itemTypeLbl.Text = itemTypeStr; wardrobeObj.ItemType = itemTypeStr; AddLastWornViewController addLastWornViewController = new AddLastWornViewController(); addLastWornViewController.wardrobeObj = wardrobeObj; Console.WriteLine("itemTypeStr is " + itemTypeStr); Console.WriteLine("wardrobeObj.itemType is " + wardrobeObj.ItemType); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(CellIdentifier); cell = new UITableViewCell(UITableViewCellStyle.Default, CellIdentifier); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; if (_wardrobeList.Count > 0) { TBL_WARDROBE values = _wardrobeList[indexPath.Row]; UILabel typeLbl = new UILabel(); typeLbl.Frame = new RectangleF(20, 5, 95, 30); typeLbl.BackgroundColor = UIColor.Clear; typeLbl.Text = values.ItemType; //typeLbl.Font = commonHelper.BoldTextFont; cell.ContentView.AddSubview(typeLbl); UILabel descLbl = new UILabel(); descLbl.Frame = new RectangleF(115, 5, w - 155, 30); descLbl.BackgroundColor = UIColor.Clear; descLbl.Text = values.ItemDesc; //descLbl.Font = commonHelper.TextFont; cell.ContentView.AddSubview(descLbl); UILabel lastWornLbl = new UILabel(); lastWornLbl.Frame = new RectangleF(20f, 35f, 314, 25f); lastWornLbl.BackgroundColor = UIColor.Clear; lastWornLbl.Text = (values.LastWorn).ToString(); //lastWornLbl.Font = commonHelper.TextFont; cell.ContentView.AddSubview(lastWornLbl); } else { cell.TextLabel.Text = messageManager.NoResultMessage; //cell.TextLabel.Font = commonHelper.TextFont; cell.TextLabel.TextAlignment = UITextAlignment.Center; cell.Accessory = UITableViewCellAccessory.None; } return(cell); }