Back to Devexpress

TextEdit.MaskUseAsDisplayFormat Property

wpf-devexpress-dot-xpf-dot-editors-dot-textedit-0a95c230.md

latest4.1 KB
Original Source

TextEdit.MaskUseAsDisplayFormat Property

Gets or sets whether display values are still formatted using the mask when the editor is not focused. This is a dependency property.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public bool MaskUseAsDisplayFormat { get; set; }
vb
Public Property MaskUseAsDisplayFormat As Boolean

Property Value

TypeDescription
Boolean

true, if the mask settings are used to format display values when the editor is not focused; false if the settings specified by the BaseEditSettings.DisplayFormat property are used.

|

Remarks

Set the MaskUseAsDisplayFormat property to true to use the editor’s mask settings to format its display text when the editor is not focused. As a result, the editor’s text in edit and display modes will be identical.

Refer to the following help topics for more information: Masked Input, Format Specifiers.

Example

xaml
<!-- 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" />

The following code snippets (auto-collected from DevExpress Examples) contain references to the MaskUseAsDisplayFormat 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.

wpf-scheduler-highlight-time-intervals/CS/SchedulerCellTemplate/MainWindow.xaml#L19

xml
<dxe:TextEdit EditValue="{Binding LunchStart, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                  Mask="HH:mm:ss" MaskType="DateTime" MaskUseAsDisplayFormat="True" Margin="4,0,4,0" />
</dxlc:LayoutItem>

wpf-reporting-use-custom-controls-for-editing-report-content-in-print-preview/CS/App.xaml#L17

xml
MaxValue="{Binding Path=(dxp:DocumentPreviewControl.ActualViewer).DataContext.DateTimeMax, RelativeSource={RelativeSource Self}}"
              MaskUseAsDisplayFormat="True" Mask="MMMM dd, yyyy" ShowWeekNumbers="True" ShowToday="True" Name="PART_Editor" />
</DataTemplate>

wpf-synchronous-theme-preload-with-splashscreen/CS/ThemePreloadwithSplashscreen/ComplexWindow.xaml#L117

xml
MaskType="Simple"
MaskUseAsDisplayFormat="True">
<dxe:ImageButtonInfo Glyph="{dx:DXImage 'SvgImages/Outlook Inspired/Glyph_Phone.svg'}" />

See Also

TextEdit Class

TextEdit Members

DevExpress.Xpf.Editors Namespace