public override void ViewDidLoad() { base.ViewDidLoad(); imageHelper = new ListingImageDownloader(Post.Link, Post.ImageLink); tableItems = GetTableSetup(); tableSource = new PostingInfoTableSource(this, tableItems, Post, imageHelper); PostingInfoTableView.Source = tableSource; PostingInfoTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; myNavItem.SetRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Done, DismissClicked), true); if (!AppDelegate.databaseConnection.PostingAlreadySaved(Post)) { saveButton = new UIBarButtonItem( UIImage.FromBundle("save"), UIBarButtonItemStyle.Plain, SaveListing ); saveButton.Enabled = true; myNavItem.LeftBarButtonItem = saveButton; } else { deleteButton = new UIBarButtonItem(UIBarButtonSystemItem.Trash, DeleteListing); myNavItem.SetLeftBarButtonItem(deleteButton, true); } tableSource.DescriptionLoaded += (object sender, DescriptionLoadedEventArgs e) => { // PostingInfoTableView.ReloadRows(new NSIndexPath[] {e.DescriptionRow}, UITableViewRowAnimation.Automatic); PostingInfoTableView.ReloadData(); }; imageHelper.loadingComplete += ImageHelper_loadingComplete; }
void ImageHelper_loadingComplete(object sender, EventArgs e) { if (imageHelper.PostingMapFound) { tableItems.Insert(4, new TableItem() { Heading = "Posting Map", CellType = "PostingMap", }); } PostingInfoTableView.ReloadData(); }