C# Класс Watchdog.Validation.Core.Internal.ElementValidationHandler

A manager for a single FrameworkElement. This is the lowest-level in Watchdog, where the controls are forced into error with an artifical dummy binding between two do-nothing DependencyProperty which are attached to the FrameworkElement and marked as invalid.
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
ValidationSourceProperty System.Windows.DependencyProperty
ValidationTargetProperty System.Windows.DependencyProperty

Открытые методы

Метод Описание
Clear ( ) : void

Clears the errorHostingBindingExpr of any validation errors.

CreateValError ( ConversionError e ) : void

Creates the val error.

ElementValidationHandler ( FrameworkElement element ) : System

Initializes a new instance of the ElementValidationHandler class. Sets of a WeakReference to the given element. The rest of the invalid mechanisms are not initialized until the first time we need to invalid the element.

GetValidationSource ( DependencyObject obj ) : string

Gets the validation source property value.

GetValidationTarget ( DependencyObject obj ) : string

Gets the validation target property value.

SetValidationSource ( DependencyObject obj, string value ) : void

Sets the validation source property value.

SetValidationTarget ( DependencyObject obj, string value ) : void

Sets the validation target property value.

Show ( string message ) : void

Shows the specified message. This is accomplished by marking the errorHostingBindingExpr as invalid with a ValidationError containing the given message.

Приватные методы

Метод Описание
EnsureBinding ( ) : void

Checks for existence (and creates if necessary) the rules and bindings need to flag the control as invalid.

Описание методов

Clear() публичный Метод

Clears the errorHostingBindingExpr of any validation errors.
public Clear ( ) : void
Результат void

CreateValError() публичный Метод

Creates the val error.
public CreateValError ( ConversionError e ) : void
e ConversionError The e.
Результат void

ElementValidationHandler() публичный Метод

Initializes a new instance of the ElementValidationHandler class. Sets of a WeakReference to the given element. The rest of the invalid mechanisms are not initialized until the first time we need to invalid the element.
public ElementValidationHandler ( FrameworkElement element ) : System
element System.Windows.FrameworkElement The element.
Результат System

GetValidationSource() публичный статический Метод

Gets the validation source property value.
public static GetValidationSource ( DependencyObject obj ) : string
obj System.Windows.DependencyObject The obj.
Результат string

GetValidationTarget() публичный статический Метод

Gets the validation target property value.
public static GetValidationTarget ( DependencyObject obj ) : string
obj System.Windows.DependencyObject The obj.
Результат string

SetValidationSource() публичный статический Метод

Sets the validation source property value.
public static SetValidationSource ( DependencyObject obj, string value ) : void
obj System.Windows.DependencyObject The obj.
value string The value.
Результат void

SetValidationTarget() публичный статический Метод

Sets the validation target property value.
public static SetValidationTarget ( DependencyObject obj, string value ) : void
obj System.Windows.DependencyObject The obj.
value string The value.
Результат void

Show() публичный Метод

Shows the specified message. This is accomplished by marking the errorHostingBindingExpr as invalid with a ValidationError containing the given message.
public Show ( string message ) : void
message string The message.
Результат void

Описание свойств

ValidationSourceProperty публичное статическое свойство

Registers the ValidationSource attached DependencyProperty. This property does nothing but serve as one end of a binding that we use to mark the FrameworkElement as invalid.
public static DependencyProperty,System.Windows ValidationSourceProperty
Результат System.Windows.DependencyProperty

ValidationTargetProperty публичное статическое свойство

Registers the ValidationTarget attached DependencyProperty. This property does nothing but serve as one end of a binding that we use to mark the FrameworkElement as invalid.
public static DependencyProperty,System.Windows ValidationTargetProperty
Результат System.Windows.DependencyProperty