Class
ValidationControl

Visual representation of errors provided through INotifyDataErrorInfo interface.

Definition

Namespace:Telerik.UI.Xaml.Controls.Primitives

Assembly:Telerik.WinUI.Controls.dll

Syntax:

cs-api-definition
public class ValidationControl : RadControl

Inheritance: objectRadControlValidationControl

Inherited Members RadControl.EndVisualStateUpdate(bool, bool)RadControl.UpdateVisualState(bool)RadControl.BeginVisualStateUpdate()RadControl.OnCreateAutomationPeer()RadControl.SetVisualState(string, bool)RadControl.CanUpdateVisualState()RadControl.MeasureOverride(Size)RadControl.ArrangeOverride(Size)RadControl.OnApplyTemplate()RadControl.UnapplyTemplateCore()RadControl.OnIsEnabledChanged(bool, bool)RadControl.LoadCore()RadControl.OnLoaded()RadControl.UnloadCore()RadControl.CurrentVisualStateRadControl.IsLoadedRadControl.IsLoadingRadControl.IsUnloadedRadControl.WasUnloadedRadControl.IsTemplateApplied

Constructors

ValidationControl()

Initializes a new instance of the ValidationControl class.

Declaration

cs-api-definition
public ValidationControl()

Fields

ControlPeerProperty

Identifies the ControlPeer dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ControlPeerProperty

Field Value

DependencyProperty

DataItemProperty

Identifies the DataItem dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DataItemProperty

Field Value

DependencyProperty

IsValidProperty

Identifies the IsValid dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsValidProperty

Field Value

DependencyProperty

PropertyNameProperty

Identifies the PropertyName dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty PropertyNameProperty

Field Value

DependencyProperty

RelativePositionOffsetProperty

Identifies the RelativePositionOffset dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty RelativePositionOffsetProperty

Field Value

DependencyProperty

ValidateOnErrorsProperty

Identifies the ValidateOnErrors dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ValidateOnErrorsProperty

Field Value

DependencyProperty

Properties

ControlPeer

Gets or sets the control that will be used to position validation control.

Declaration

cs-api-definition
public FrameworkElement ControlPeer { get; set; }

Property Value

FrameworkElement

DataItem

Gets or sets the data item that if implements INotifyDataErrorInfo interface will be used as source for errors.

Declaration

cs-api-definition
public object DataItem { get; set; }

Property Value

object

Errors

Gets the collection of current errors.

Declaration

cs-api-definition
public BindableCollection<object> Errors { get; }

Property Value

BindableCollection<object>

IsValid

Gets or sets a value indicating whether control is in valid state.

Declaration

cs-api-definition
public bool IsValid { get; set; }

Property Value

bool

PropertyName

Gets or sets the name of the property that will be validated.

Declaration

cs-api-definition
public string PropertyName { get; set; }

Property Value

string

The name of the property.

RelativePositionOffset

Gets or sets the relative offset from ControlPeer control.

Declaration

cs-api-definition
public Point RelativePositionOffset { get; set; }

Property Value

Point

ValidateOnErrors

Gets or sets a value indicating whether control should trigger validation when error occurs.

Declaration

cs-api-definition
public bool ValidateOnErrors { get; set; }

Property Value

bool

Methods

ApplyTemplateCore()

Called when the Framework is called. Inheritors should override this method should they have some custom template-related logic. This is done to ensure that the property is properly initialized.

Declaration

cs-api-definition
protected override bool ApplyTemplateCore()

Returns

bool

Overrides RadControl.ApplyTemplateCore()

ComposeVisualStateName()

Builds the current visual state for this instance.

Declaration

cs-api-definition
protected override string ComposeVisualStateName()

Returns

string

Overrides RadControl.ComposeVisualStateName()

OnTemplateApplied()

Occurs when the method has been called and the template is already successfully applied.

Declaration

cs-api-definition
protected override void OnTemplateApplied()

Overrides RadControl.OnTemplateApplied()

OnValidating(IList<object>)

Called to raise Validating event.

Declaration

cs-api-definition
protected virtual ValidatingEventArgs OnValidating(IList<object> currentErrors)

Parameters

currentErrors

IList<object>

The current errors.

Returns

ValidatingEventArgs

Validate(bool)

Validates the data updates the Errors collection.

Declaration

cs-api-definition
public void Validate(bool callAsync = true)

Parameters

callAsync

bool

Whether the validation will be executed asynchronously.

Events

Validating

Occurs when validating item.

Declaration

cs-api-definition
public event EventHandler<ValidatingEventArgs> Validating

Event Value

EventHandler<ValidatingEventArgs>