public override void ViewDidLoad() { base.ViewDidLoad(); CustomNavigationBar.TintColor = StyleHelper.Style.AccentColor; if (StyleHelper.Style.UseLogoInsteadOfConnectionStatus) { var titleImage = new UIImageView { Image = UIImage.FromBundle(StyleHelper.Style.LogoBoundleName) }; CustomNavigationItem.AddTitleView(titleImage); } else { _customTitleView = new ConnectionStatusView(CGRect.Empty); CustomNavigationItem.AddTitleView(_customTitleView); } CustomNavigationItem.SetCommand(UIBarButtonSystemItem.Add, ViewModel.CreateChatCommand, false); ChatsTableView.RegisterNibForCellReuse(ChatSummaryViewCell.Nib, ChatSummaryViewCell.Key); ChatsTableView.RowHeight = 80; ChatsTableView.TableFooterView = new UIView(); var source = ViewModel.Chats.GetTableViewSource((cell, viewModel, index) => { (cell as ChatSummaryViewCell).BindViewModel(viewModel); }, ChatSummaryViewCell.Key); ChatsTableView.Source = source; ChatsTableView.Delegate = new CustomViewDelegate(source, ViewModel); _sourceRef = WeakReferenceEx.Create(source); }
void ReleaseDesignerOutlets() { if (ChatsTableView != null) { ChatsTableView.Dispose(); ChatsTableView = null; } if (LoginButton != null) { LoginButton.Dispose(); LoginButton = null; } if (CustomNavigationItem != null) { CustomNavigationItem.Dispose(); CustomNavigationItem = null; } if (CustomNavigationBar != null) { CustomNavigationBar.Dispose(); CustomNavigationBar = null; } }
public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); var indexPath = ChatsTableView.IndexPathForSelectedRow; if (indexPath != null) { ChatsTableView.DeselectRow(indexPath, false); } }