public void PopulateTable() { Console.WriteLine("PopulateTable ()"); table = new UITableView(new RectangleF(0,66,View.Bounds.Width,View.Bounds.Height -66f)); table.BackgroundColor = UIColor.Clear; IList<Item> tableItems= AppDelegate.dao.GetAllItemsInBox(boks); this.itemtableSource = new TableSourceItems (tableItems); this.itemtableSource.ItemDeleted += (object sender, ItemClickedEventArgs e) => this.DeleteTaskRow(e.Item.ID); this.itemtableSource.ItemClicked += (object sender, ItemClickedEventArgs e) => this.ShowItemDetails(e.Item); table.Source = this.itemtableSource; Add (table); }
protected override void Dispose(bool disposing) { ActivateDetail = null; table.Dispose (); source = null; backbutton = null; itemdetail = null; base.Dispose (disposing); }
void PopulateTable() { IList<Item> items = AppDelegate.dao.GetAllItems (); source = new TableSourceItems (items); table.Source = source; source.ItemClicked += (object sender, ItemClickedEventArgs e) => this.ShowItemDetails(e.Item); source.ItemDeleted += (object sender, ItemClickedEventArgs e) => { AppDelegate.dao.DeleteItem(e.Item.ID); this.Refresh(); }; backbutton = new UIButton (new RectangleF (10, 25, 48, 32)); backbutton.SetImage (backarrow.MakeBackArrow(), UIControlState.Normal); backbutton.TouchUpInside += (object sender, EventArgs e) => DismissViewControllerAsync (true); Add (backbutton); }