TextEdit.Mask Property
Gets or sets a mask expression. This is a dependency property.
Namespace: DevExpress.Xpf.Editors
Assembly: DevExpress.Xpf.Core.v24.2.dll
NuGet Package: DevExpress.Wpf.Core
#Declaration
#Property Value
Type | Description |
---|---|
String | A string representing a mask expression. |
#Remarks
When the editor’s value is set using the Text property, the editor’s value is of System.String type and the Numeric and DateTime mask types may apply incorrectly. Specify the editor’s value using the EditValue property to correctly apply mask settings.
Note
The following Text
#Specify Mask in Design Time
You can use the Mask Editor to specify editor’s Mask.
#Specify Mask in Code
<!-- Long date -->
<dxe:TextEdit Mask="D" MaskType="DateTime"
MaskUseAsDisplayFormat="True" />
<!-- Currency -->
<dxe:TextEdit Mask="c" MaskType="Numeric"
MaskUseAsDisplayFormat="True" />
<!-- Email address -->
<dxe:TextEdit Mask="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}"
MaskType="RegEx" MaskUseAsDisplayFormat="True" />
To learn more, see Masked Input.
#Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Mask property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.