C# Class 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.
Afficher le fichier Open project: JDolinger/Watchdog

Méthodes publiques

Свойство Type Description
ValidationSourceProperty System.Windows.DependencyProperty
ValidationTargetProperty System.Windows.DependencyProperty

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
EnsureBinding ( ) : void

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

Method Details

Clear() public méthode

Clears the errorHostingBindingExpr of any validation errors.
public Clear ( ) : void
Résultat void

CreateValError() public méthode

Creates the val error.
public CreateValError ( ConversionError e ) : void
e ConversionError The e.
Résultat void

ElementValidationHandler() public méthode

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.
Résultat System

GetValidationSource() public static méthode

Gets the validation source property value.
public static GetValidationSource ( DependencyObject obj ) : string
obj System.Windows.DependencyObject The obj.
Résultat string

GetValidationTarget() public static méthode

Gets the validation target property value.
public static GetValidationTarget ( DependencyObject obj ) : string
obj System.Windows.DependencyObject The obj.
Résultat string

SetValidationSource() public static méthode

Sets the validation source property value.
public static SetValidationSource ( DependencyObject obj, string value ) : void
obj System.Windows.DependencyObject The obj.
value string The value.
Résultat void

SetValidationTarget() public static méthode

Sets the validation target property value.
public static SetValidationTarget ( DependencyObject obj, string value ) : void
obj System.Windows.DependencyObject The obj.
value string The value.
Résultat void

Show() public méthode

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.
Résultat void

Property Details

ValidationSourceProperty public_oe static_oe property

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
Résultat System.Windows.DependencyProperty

ValidationTargetProperty public_oe static_oe property

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
Résultat System.Windows.DependencyProperty