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.
Exibir arquivo Open project: JDolinger/Watchdog

Public Properties

Property Type Description
ValidationSourceProperty System.Windows.DependencyProperty
ValidationTargetProperty System.Windows.DependencyProperty

Public Methods

Method 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

Method 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 method

Clears the errorHostingBindingExpr of any validation errors.
public Clear ( ) : void
return void

CreateValError() public method

Creates the val error.
public CreateValError ( ConversionError e ) : void
e ConversionError The e.
return void

ElementValidationHandler() public method

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.
return System

GetValidationSource() public static method

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

GetValidationTarget() public static method

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

SetValidationSource() public static method

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

SetValidationTarget() public static method

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

Show() public method

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.
return 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
return 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
return System.Windows.DependencyProperty