public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { if (indexPath.Section == 0) { return; } var url = serverUrl.TextInput.Text; var key = userKey.TextInput.Text; InvokeOnMainThread(() => { ResetButton(); }); LoadingIndicator.Instance.StartLoading(); new Login().ValidateAndStore(url, key, (str) => { InvokeOnMainThread(() => { if (str == Login.ValidationSuccess) { buttonCell.BackgroundColor = UIColor.FromRGB(0, 128, 0); buttonCell.TextLabel.Text = "Success"; } else { buttonCell.BackgroundColor = UIColor.FromRGB(128, 0, 0); buttonCell.TextLabel.Text = "Could not connect"; } buttonCell.SetSelected(false, true); }); LoadingIndicator.Instance.StopLoading(); controller.LoginAction(str); }); }