Back to Devexpress

ValidationService.HasValidationError Attached Property

wpf-devexpress-dot-xpf-dot-editors-dot-validationservice-752e7b4c.md

latest2.1 KB
Original Source

ValidationService.HasValidationError Attached Property

Indicates whether validation has failed. This is an attached property.

Namespace : DevExpress.Xpf.Editors

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

NuGet Package : DevExpress.Wpf.Core

Declaration

See GetHasValidationError(DependencyObject).

Returns

TypeDescription
Boolean

true if validation has failed; otherwise, false.

|

Remarks

The ValidationService.HasValidationError attached property returns true for container controls that contain editors with validation errors. This property detects the following validation types (supported by DevExpress WPF Controls): validation interfaces, the Validate event, the ValidationService class, and ValidationRule descendants.

xaml
<Border dxe:ValidationService.IsValidationContainer="True"
        BorderThickness="2" 
        BorderBrush="{Binding Path=(dxe:ValidationService.HasValidationError), 
                              Converter={dxmvvm:BooleanToObjectConverter TrueValue=Red, FalseValue=Black}, 
                              RelativeSource={RelativeSource Self}}">
    <dxe:TextEdit Validate="OnValidate"/>
</Border>

The ValidationErrors property returns a collection of validation errors.

See Also

ValidationService Class

ValidationService Members

DevExpress.Xpf.Editors Namespace