You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/articles/features/ui-controls-validator.md
+108Lines changed: 108 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,3 +5,111 @@ title: Using the InputValidator control | MADE.NET
5
5
6
6
# Using the InputValidator control
7
7
8
+
The `MADE.UI.Controls.InputValidator` element is a custom-built UI element wrapper for input controls that works with [Uno's supported platforms](https://platform.uno/) that provides an input validation experience.
9
+
10
+
Shown below is the visuals for the control in its default state validating a `TextBox` and `DatePicker` with input validators from the `MADE.NET.Data.Validation` library.
11
+
12
+
<imgsrc="../../images/InputValidator.png"alt="InputValidator usages for a TextBox and DatePicker" />
The `InputValidator` is designed in a way that it can be used with any input control, whether in-built like `TextBox` or custom-built like the MADE `FilePicker` control.
88
+
89
+
Simply, the `Input` property of the validator needs to be bound to the input value reference from the wrapped input control that needs to be validated.
90
+
91
+
You can then provide a `ValidatorCollection` instance from the [Data Validation package](data-validation.md), containing the `IValidator` instances that will be run on the input.
92
+
93
+
This can either be a bound property in your view-model, set in your view code-behind, or defined in your XAML as a static resource.
94
+
95
+
The implementation of using `IValidator` instances allows you to dynamically configure your validators based on other criteria of your view.
96
+
97
+
For example, you might want to validate two `DatePicker` controls that define a min/max range. The validator for the maximum date could be dynamically updated so that its minimum value is defined based on the value of the minimum date picker.
98
+
99
+
## Extending input validation for your application's needs
100
+
101
+
The validation of the `InputValidator` is based on `IValidator` instances from the Data Validation package.
102
+
103
+
While the package provides a common set of validators for basic scenarios such as required, range, min, max, and email, you can create your own.
104
+
105
+
Find more detail on creating your own custom `IValidator` types in our [Data Validation article](data-validation.md#creating-your-own-custom-data-validators).
106
+
107
+
## Customizing the InputValidator
108
+
109
+
The control has many customization properties that are exposed to tailor the experience for your application.
110
+
111
+
### FeedbackMessageStyle
112
+
113
+
The `FeedbackMessageStyle` controls the styling applied to the `TextBlock` that displays the validator messages.
114
+
115
+
The default user experience styling is shown at the top of this article.
0 commit comments