Baseflow / Baseflow/XF-Material-Library

Question about MaterialDialog

Open
#220 1 comment 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
633
Forks
150
PR merge metrics
No merged PRs in 30d

Description

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);`
` }`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.