C# Class Watchdog.Validation.Core.Internal.ValidationScope

The implementation of validation management for a portion of a WPF LogicalTree. When FrameworkElement register themseives with the scope, it figures which field they are associated with, typically through the the property name that the element is bound to. The scope also is given a ICollection{T}. When the collection is modified, the scope makes the association between the errors and the logical field that the error should be attached to. Additionally, the scope watches for any WPF Validation errors created by any controls under the scope. If found, they are inserted into the collection. This way the ViewModel layer of an application (which supplied the collection), is now aware of these types of error.
Exibir arquivo Open project: JDolinger/Watchdog Class Usage Examples

Public Methods

Method Description
ValidationScope ( FrameworkElement root ) : System

Initializes a new instance of the ValidationScope class.

Private Methods

Method Description
HandleDataConversionError ( object sender, System.Windows.Controls.ValidationErrorEventArgs args ) : void
OnAdded ( Watchdog.Validation.Core.ValidationError added ) : void

Called when an IError has been added to the collection. It handles finding the IField with the given fieldKey and adding the error to the field.

OnCleared ( ) : void
OnRemoved ( Watchdog.Validation.Core.ValidationError removed ) : void

Called when an IError has been removed from the collection. It handles finding the IField with the given fieldKey and removing the error to the field.

ReattachConversionErrors ( ) : void
Register ( FrameworkElement element ) : void

Method Details

ValidationScope() public method

Initializes a new instance of the ValidationScope class.
public ValidationScope ( FrameworkElement root ) : System
root System.Windows.FrameworkElement The root element of the scope where the initial has been attached.
return System