partial void RegisterButton_TouchUpInside(UIButton sender) { UIAlertView alert = new UIAlertView(); SaveValues(); alert.Title = "Enter Password"; alert.AddButton("Register"); alert.AddButton("Cancel"); alert.AlertViewStyle = UIAlertViewStyle.SecureTextInput; alert.Clicked += (object s, UIButtonEventArgs ev) => { if (ev.ButtonIndex == 0) { InvokeOnMainThread(async() => { string psswd = alert.GetTextField(0).Text; if (String.IsNullOrEmpty(psswd) || psswd.Length < 4) { ShowInfo("Bad Password"); return; } int result = await _settingsController.DoRegister(psswd); HandleRegisterResult(result); }); } else { return; } }; alert.Show(); }