Please look at the custom dialog below. I have an edittext field on the dialog and if the text field is empty I would like to disable the positiveButton. I can
You can write a listener to the edit text box, and try to enable or disable buttons. This is a sample code for xamarin.
var dialog = builder.Create();
dialog.Show();
var btnOk = dialog.GetButton((int)DialogButtonType.Positive).Enabled = false;
_enterTextDialogEditText.AfterTextChanged += (sender, e) => {
if (!string.IsNullOrEmpty(_enterTextDialogEditText.Text)) {
dialog.GetButton((int)DialogButtonType.Positive).Enabled = true;
} else {
dialog.GetButton((int)DialogButtonType.Positive).Enabled = false;
}
};