void ReleaseDesignerOutlets() { if (ArchiveButton != null) { ArchiveButton.Dispose(); ArchiveButton = null; } if (InboxTableView != null) { InboxTableView.Dispose(); InboxTableView = null; } if (MarkAsReadButton != null) { MarkAsReadButton.Dispose(); MarkAsReadButton = null; } if (Toolbar != null) { Toolbar.Dispose(); Toolbar = null; } if (ToolbarBottom != null) { ToolbarBottom.Dispose(); ToolbarBottom = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); UIImage logoImage = UIImage.FromBundle("header"); NavigationItem.TitleView = new UIImageView(logoImage); NSNotificationCenter notficationCenter = NSNotificationCenter.DefaultCenter; // Register for inbox notication notficationCenter.AddObserver(AccengageIOS.Constants.BMA4SInBoxDataChanged, inboxChanged); // Register for cell notification notficationCenter.AddObserver(new NSString("RefreshInbox"), inboxRefresh); // Set Title // Ex : Inbox (3) if (inbox != null) { Title = "Inbox " + inbox.UnreadMessageCount.ToString(); } // Initialize the refresh controll refreshControl = new UIRefreshControl(); refreshControl.BackgroundColor = UIColor.FromWhiteAlpha(0, 0.1f); refreshControl.AddTarget((sender, e) => { reloadData(); }, UIControlEvent.ValueChanged); InboxTableView.AddSubview(refreshControl); InvokeOnMainThread(delegate { refreshControl.BeginRefreshing(); refreshControl.EndRefreshing(); }); // Add Edit Buttonn UIBarButtonItem rigthButton = new UIBarButtonItem("edit", UIBarButtonItemStyle.Plain, startEditing); rigthButton.TintColor = UIColor.White; if (NavigationItem != null) { NavigationItem.RightBarButtonItem = rigthButton; } InboxTableView.Delegate = new InboxTableViewDelegate(this); reloadData(); }
void activeEditionState(bool actived) { InboxTableView.SetEditing(actived, true); UIImage image = UIImage.FromBundle("edit"); if (InboxTableView.Editing) { image = UIImage.FromBundle("save"); } NavigationItem.RightBarButtonItem.Image = image; updateToolBarPosition(); updateUIandData(); }
void updateUIandData() { // update table content InboxTableView.DataSource = new InboxTableViewSource(inbox); InboxTableView.ReloadData(); //title updating if (inbox != null) { Title = "Inbox " + inbox.UnreadMessageCount.ToString(); NavigationController.TabBarItem.BadgeValue = inbox.UnreadMessageCount.ToString(); } // End the refreshing if (refreshControl != null) { string title = "Last update: " + DateTime.Now.ToString("MMM d, hh:mm"); NSAttributedString attributedTitle = new NSAttributedString(title, null, UIColor.DarkGray); refreshControl.AttributedTitle = attributedTitle; refreshControl.EndRefreshing(); } }
void inboxRefresh(NSNotification obj) { InboxTableView.ReloadData(); }