ExtensionMethods methods

ClearValidationError method

Hides validation error message on a control.

Syntax

public static void ClearValidationError(this FrameworkElement frameworkElement)

Parameters

frameworkElement

Type:    System.Windows.FrameworkElement

The object instance of the control assigned for the validation.

 

 

IsValidationErrorRaised method

Gets a flag indicating whether a validation error is shown on a control.

Syntax

public static bool IsValidationErrorRaised(this FrameworkElement frameworkElement)

 

Parameters

frameworkElement

Type:    System.Windows.FrameworkElement

The object instance of the control assigned for validation.

Return value

Type:    System.Boolean

 

 

RaiseValidationError method

Shows validation error message on a control. The error message however must be set in advance by calling the SetValidation() method .

Syntax

public static void RaiseValidationError(this FrameworkElement frameworkElement)

Parameters

frameworkElement

Type:    System.Windows.FrameworkElement

The object instance of the control assigned for validation.

 

SetValidation method

Sets validation error message to be shown on a control. The message however is not shown until the control is validated or method RaiseValidationError() is called.

Syntax

public static void SetValidation(
this FrameworkElement frameworkElement,
string message
)

Parameters

frameworkElement

Type:    System.Windows.FrameworkElement

The object instance of the control assigned for validation.

message

Type:    System.String

The validation error message to be shown on the frameworkElement control.