void ReleaseDesignerOutlets() { if (ScrollView != null) { ScrollView.Dispose(); ScrollView = null; } if (ButtonView != null) { ButtonView.Dispose(); ButtonView = null; } if (CloseButton != null) { CloseButton.Dispose(); CloseButton = null; } if (CountryTableView != null) { CountryTableView.Dispose(); CountryTableView = null; } if (ListExplainLbl != null) { ListExplainLbl.Dispose(); ListExplainLbl = null; } if (NextBtn != null) { NextBtn.Dispose(); NextBtn = null; } if (SubtitleLbl != null) { SubtitleLbl.Dispose(); SubtitleLbl = null; } if (TableViewHeightConstraint != null) { TableViewHeightConstraint.Dispose(); TableViewHeightConstraint = null; } if (TitleLbl != null) { TitleLbl.Dispose(); TitleLbl = null; } }
async void SetupTableView() { _spinner = StyleUtil.ShowSpinner(View, UIActivityIndicatorViewStyle.WhiteLarge); _countryList = await _viewModel.GetListOfCountriesAsync(); if (!_countryList.Any()) { _spinner?.RemoveFromSuperview(); OnServerError(); return; } InvokeOnMainThread(() => { TableViewHeightConstraint.Constant = _countryList.Count * CountryTableCell.ROW_HEIGHT; _spinner?.RemoveFromSuperview(); CountryTableView.RegisterNibForCellReuse(CountryTableCell.Nib, CountryTableCell.Key); CountryTableView.Source = new CountryTableViewSource(_countryList); CountryTableView.ReloadData(); }); }