C# Class Bennedik.Validation.Integration.WPF.ErrorProvider

This ErrorProvider is adapted to the Validation Application Block from Paul Stovell's CodeProject article at http://www.codeproject.com/WPF/wpfvalidation.asp. The ErrorProvider is a Decorator. It adds an EnterpriseValidationRule to all contained Bindings.
(c) 2007, 2008 Martin Bennedik, see BSD license in the license.txt file http://www.bennedik.de
Inheritance: System.Windows.Controls.Decorator
Afficher le fichier Open project: RookieOne/WPF-Input-Validation

Private Properties

Свойство Type Description
AddEnterpriseValidationRule void
ErrorProvider_Loaded void
FindBindingsRecursively void

Méthodes publiques

Méthode Description
ErrorProvider ( ) : System
GetFirstInvalidElement ( ) : FrameworkElement

Returns the first element that this error provider has labelled as invalid. This method is useful to set the users focus on the first visible error field on a page.

Init ( ) : void
Validate ( ) : bool

Validates all properties on the current data source.

Note that only errors on properties that are displayed are included. Other errors, such as errors for properties that are not displayed, will not be validated by this method.

Private Methods

Méthode Description
AddEnterpriseValidationRule ( FrameworkElement element, Binding binding, DependencyProperty dp ) : void
ErrorProvider_Loaded ( object sender, RoutedEventArgs e ) : void
FindBindingsRecursively ( DependencyObject element, FoundBindingCallbackDelegate callbackDelegate ) : void

Recursively goes through the control tree, looking for bindings on the current data context.

Method Details

ErrorProvider() public méthode

public ErrorProvider ( ) : System
Résultat System

GetFirstInvalidElement() public méthode

Returns the first element that this error provider has labelled as invalid. This method is useful to set the users focus on the first visible error field on a page.
public GetFirstInvalidElement ( ) : FrameworkElement
Résultat System.Windows.FrameworkElement

Init() public méthode

public Init ( ) : void
Résultat void

Validate() public méthode

Validates all properties on the current data source.
Note that only errors on properties that are displayed are included. Other errors, such as errors for properties that are not displayed, will not be validated by this method.
public Validate ( ) : bool
Résultat bool