Table of Contents

Class DataValidationErrors

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

A control which displays an error notifier when there is a DataValidationError. Provides attached properties to track errors on a control

[PseudoClasses(new string[] { ":error" })]
public class DataValidationErrors : ContentControl, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
DataValidationErrors
Implements
Inherited Members
Extension Methods

Remarks

You will probably only want to create instances inside of control templates.

Constructors

DataValidationErrors()

public DataValidationErrors()

Fields

ErrorConverterProperty

Defines the DataValidationErrors.ErrorConverter attached property.

public static readonly AttachedProperty<Func<object, object>?> ErrorConverterProperty

Field Value

AttachedProperty<Func<object, object>>

ErrorTemplateProperty

Defines the DataValidationErrors.ErrorTemplate property.

public static readonly StyledProperty<IDataTemplate> ErrorTemplateProperty

Field Value

StyledProperty<IDataTemplate>

ErrorsProperty

Defines the DataValidationErrors.Errors attached property.

public static readonly AttachedProperty<IEnumerable<object>?> ErrorsProperty

Field Value

AttachedProperty<IEnumerable<object>>

HasErrorsProperty

Defines the DataValidationErrors.HasErrors attached property.

public static readonly AttachedProperty<bool> HasErrorsProperty

Field Value

AttachedProperty<bool>

OwnerProperty

public static readonly DirectProperty<DataValidationErrors, Control?> OwnerProperty

Field Value

DirectProperty<DataValidationErrors, Control>

Properties

ErrorTemplate

public IDataTemplate ErrorTemplate { get; set; }

Property Value

IDataTemplate

Owner

public Control? Owner { get; set; }

Property Value

Control

Methods

ClearErrors(Control)

public static void ClearErrors(Control control)

Parameters

control Control

GetErrorConverter(Control)

public static Func<object, object?>? GetErrorConverter(Control control)

Parameters

control Control

Returns

Func<object, object>

GetErrors(Control)

public static IEnumerable<object>? GetErrors(Control control)

Parameters

control Control

Returns

IEnumerable<object>

GetHasErrors(Control)

public static bool GetHasErrors(Control control)

Parameters

control Control

Returns

bool

SetError(Control, Exception?)

public static void SetError(Control control, Exception? error)

Parameters

control Control
error Exception

SetErrorConverter(Control, Func<object, object>?)

public static void SetErrorConverter(Control control, Func<object, object>? converter)

Parameters

control Control
converter Func<object, object>

SetErrors(Control, IEnumerable<object>?)

public static void SetErrors(Control control, IEnumerable<object>? errors)

Parameters

control Control
errors IEnumerable<object>