XF-Material-Library
XF-Material-Library copied to clipboard
Question about MaterialDialog
I use MaterialDialog.Instance.ShowCustomContentAsync to show a more complex view. What I want to do is to attach validations to Confirmation Button such that, the dialog does not close until the validation errors are fixed. Is there a way to attach Validations to MaterialDialog Confirmation Button?
Here is my example code
var config = new MaterialInputDialogConfiguration()
{
CornerRadius = 8,
BackgroundColor = Color.FromHex("#2c3e50"),
InputTextColor = Color.White,
InputPlaceholderColor = Color.White.MultiplyAlpha(0.6),
TintColor = Color.White,
TitleTextColor = Color.White,
MessageTextColor = Color.FromHex("#DEFFFFFF")
};
MyView.BindingContext = vm;
bool? returnVal = await MaterialDialog.Instance.ShowCustomContentAsync(MyView, "Add Information", "Hello World", "Add", "Cancel", config);
if (returnVal.Value)
{
await MaterialDialog.Instance.SnackbarAsync(message: "Selected: " + vm.Info1 + " " + vm.Info2, msDuration: MaterialSnackbar.DurationLong);
}
Hello @balaji830 !
Considering that XF.Material uses Rg.Plugin.Popup you have access to directly their API's, so an possible workaround would be something like this:
PopupNavigation.Instance.PopAsyc()
To remove the last popup on the stack opened.