C# Class WinRTXamlToolkit.Controls.Extensions.FieldValidationExtensions

Attached properties for handling basic validation of field values.
Afficher le fichier Open project: xyzzer/WinRTXamlToolkit Class Usage Examples

Méthodes publiques

Свойство Type Description
DefaultErrorMessageProperty Windows.UI.Xaml.DependencyProperty
FormatProperty Windows.UI.Xaml.DependencyProperty
FormatValidationHandlerProperty Windows.UI.Xaml.DependencyProperty
InvalidBrushProperty Windows.UI.Xaml.DependencyProperty
IsValidProperty Windows.UI.Xaml.DependencyProperty
MinLengthErrorMessageProperty Windows.UI.Xaml.DependencyProperty
MinLengthProperty Windows.UI.Xaml.DependencyProperty
NonEmptyErrorMessageProperty Windows.UI.Xaml.DependencyProperty
NumericErrorMessageProperty Windows.UI.Xaml.DependencyProperty
PatternErrorMessageProperty Windows.UI.Xaml.DependencyProperty
PatternProperty Windows.UI.Xaml.DependencyProperty
SpecificLengthErrorMessageProperty Windows.UI.Xaml.DependencyProperty
ValidBrushProperty Windows.UI.Xaml.DependencyProperty
ValidationMessageProperty Windows.UI.Xaml.DependencyProperty
ValidationMessageVisibilityProperty Windows.UI.Xaml.DependencyProperty

Méthodes publiques

Méthode Description
GetDefaultErrorMessage ( DependencyObject d ) : string

Gets the DefaultErrorMessage property. This dependency property indicates the field value is invalid.

GetFormat ( DependencyObject d ) : ValidationChecks

Gets the Format property. This dependency property indicates the formats to validate for.

GetInvalidBrush ( DependencyObject d ) : Brush

Gets the InvalidBrush property. This dependency property indicates the brush to use to highlight a field with invalid value.

GetIsValid ( DependencyObject d ) : bool

Gets the IsValid property. This dependency property indicates whether the field value is valid.

GetMinLength ( DependencyObject d ) : int

Gets the MinLength property. This dependency property indicates minimum expected field value length if MinLength format is set.

The default value is 8 which matches a typical requirement for minimum password length. Specify another value if 8 is not the minimum value you expect when you set ValidationChecks.MinLength.

GetMinLengthErrorMessage ( DependencyObject d ) : string

Gets the MinLengthErrorMessage property. This dependency property indicates the error message to use for field that doesn't match minimum length requirement.

GetNonEmptyErrorMessage ( DependencyObject d ) : string

Gets the NonEmptyErrorMessage property. This dependency property indicates the error message to use when the field is marked non-empty and is empty.

GetNumericErrorMessage ( DependencyObject d ) : string

Gets the NumericErrorMessage property. This dependency property indicates the error message to use for a field marked numeric with non-numeric content.

GetPattern ( DependencyObject d ) : string

Gets the Pattern property. This dependency property indicates the regex pattern that the Text property needs to match.

GetPatternErrorMessage ( DependencyObject d ) : string

Gets the PatternErrorMessage property. This dependency property indicates the error message to use when the field text doesn't match requested pattern.

GetSpecificLengthErrorMessage ( DependencyObject d ) : string

Gets the SpecificLengthErrorMessage property. This dependency property indicates the error message to use for a field with an incorrect number of characters.

GetValidBrush ( DependencyObject d ) : Brush

Gets the ValidBrush property. This dependency property indicates the brush to use to highlight a successfully validated field.

GetValidationMessage ( DependencyObject d ) : string

Gets the ValidationMessage property. This dependency property indicates the validation error message if the value is not valid.

GetValidationMessageVisibility ( DependencyObject d ) : Visibility

Gets the ValidationMessageVisibility property. This dependency property indicates the visibility of the validation message.

SetDefaultErrorMessage ( DependencyObject d, string value ) : void

Sets the DefaultErrorMessage property. This dependency property indicates the field value is invalid.

SetFormat ( DependencyObject d, ValidationChecks value ) : void

Sets the Format property. This dependency property indicates the formats to validate for.

SetInvalidBrush ( DependencyObject d, Brush value ) : void

Sets the InvalidBrush property. This dependency property indicates the brush to use to highlight a field with invalid value.

SetIsValid ( DependencyObject d, bool value ) : void

Sets the IsValid property. This dependency property indicates whether the field value is valid.

SetMinLength ( DependencyObject d, int value ) : void

Sets the MinLength property. This dependency property indicates minimum expected field value length if MinLength format is set.

SetMinLengthErrorMessage ( DependencyObject d, string value ) : void

Sets the MinLengthErrorMessage property. This dependency property indicates the error message to use for field that doesn't match minimum length requirement.

SetNonEmptyErrorMessage ( DependencyObject d, string value ) : void

Sets the NonEmptyErrorMessage property. This dependency property indicates the error message to use when the field is marked non-empty and is empty.

SetNumericErrorMessage ( DependencyObject d, string value ) : void

Sets the NumericErrorMessage property. This dependency property indicates the error message to use for a field marked numeric with non-numeric content.

SetPattern ( DependencyObject d, string value ) : void

Sets the Pattern property. This dependency property indicates the regex pattern that the Text property needs to match.

SetPatternErrorMessage ( DependencyObject d, string value ) : void

Sets the PatternErrorMessage property. This dependency property indicates the error message to use when the field text doesn't match requested pattern.

SetSpecificLengthErrorMessage ( DependencyObject d, string value ) : void

Sets the SpecificLengthErrorMessage property. This dependency property indicates the error message to use for a field with an incorrect number of characters.

SetValidBrush ( DependencyObject d, Brush value ) : void

Sets the ValidBrush property. This dependency property indicates the brush to use to highlight a successfully validated field.

SetValidationMessage ( DependencyObject d, string value ) : void

Sets the ValidationMessage property. This dependency property indicates the validation error message if the value is not valid.

SetValidationMessageVisibility ( DependencyObject d, Visibility value ) : void

Sets the ValidationMessageVisibility property. This dependency property indicates the visibility of the validation message.

Private Methods

Méthode Description
GetFormatValidationHandler ( DependencyObject d ) : object
OnDefaultErrorMessageChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the DefaultErrorMessage property.

OnFormatChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the Format property.

OnFormatValidationHandlerChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the FormatValidationHandler property.

OnInvalidBrushChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the InvalidBrush property.

OnMinLengthChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the MinLength property.

OnMinLengthErrorMessageChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the MinLengthErrorMessage property.

OnNonEmptyErrorMessageChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the NonEmptyErrorMessage property.

OnNumericErrorMessageChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the NumericErrorMessage property.

OnPatternChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the Pattern property.

OnPatternErrorMessageChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the PatternErrorMessage property.

OnSpecificLengthErrorMessageChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the SpecificLengthErrorMessage property.

OnValidBrushChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the ValidBrush property.

SetFormatValidationHandler ( DependencyObject d, object value ) : void
SetupAndValidate ( DependencyObject dependencyObject ) : void

Method Details

GetDefaultErrorMessage() public static méthode

Gets the DefaultErrorMessage property. This dependency property indicates the field value is invalid.
public static GetDefaultErrorMessage ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Résultat string

GetFormat() public static méthode

Gets the Format property. This dependency property indicates the formats to validate for.
public static GetFormat ( DependencyObject d ) : ValidationChecks
d Windows.UI.Xaml.DependencyObject
Résultat ValidationChecks

GetInvalidBrush() public static méthode

Gets the InvalidBrush property. This dependency property indicates the brush to use to highlight a field with invalid value.
public static GetInvalidBrush ( DependencyObject d ) : Brush
d Windows.UI.Xaml.DependencyObject
Résultat Windows.UI.Xaml.Media.Brush

GetIsValid() public static méthode

Gets the IsValid property. This dependency property indicates whether the field value is valid.
public static GetIsValid ( DependencyObject d ) : bool
d Windows.UI.Xaml.DependencyObject
Résultat bool

GetMinLength() public static méthode

Gets the MinLength property. This dependency property indicates minimum expected field value length if MinLength format is set.
The default value is 8 which matches a typical requirement for minimum password length. Specify another value if 8 is not the minimum value you expect when you set ValidationChecks.MinLength.
public static GetMinLength ( DependencyObject d ) : int
d Windows.UI.Xaml.DependencyObject
Résultat int

GetMinLengthErrorMessage() public static méthode

Gets the MinLengthErrorMessage property. This dependency property indicates the error message to use for field that doesn't match minimum length requirement.
public static GetMinLengthErrorMessage ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Résultat string

GetNonEmptyErrorMessage() public static méthode

Gets the NonEmptyErrorMessage property. This dependency property indicates the error message to use when the field is marked non-empty and is empty.
public static GetNonEmptyErrorMessage ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Résultat string

GetNumericErrorMessage() public static méthode

Gets the NumericErrorMessage property. This dependency property indicates the error message to use for a field marked numeric with non-numeric content.
public static GetNumericErrorMessage ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Résultat string

GetPattern() public static méthode

Gets the Pattern property. This dependency property indicates the regex pattern that the Text property needs to match.
public static GetPattern ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Résultat string

GetPatternErrorMessage() public static méthode

Gets the PatternErrorMessage property. This dependency property indicates the error message to use when the field text doesn't match requested pattern.
public static GetPatternErrorMessage ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Résultat string

GetSpecificLengthErrorMessage() public static méthode

Gets the SpecificLengthErrorMessage property. This dependency property indicates the error message to use for a field with an incorrect number of characters.
public static GetSpecificLengthErrorMessage ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Résultat string

GetValidBrush() public static méthode

Gets the ValidBrush property. This dependency property indicates the brush to use to highlight a successfully validated field.
public static GetValidBrush ( DependencyObject d ) : Brush
d Windows.UI.Xaml.DependencyObject
Résultat Windows.UI.Xaml.Media.Brush

GetValidationMessage() public static méthode

Gets the ValidationMessage property. This dependency property indicates the validation error message if the value is not valid.
public static GetValidationMessage ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Résultat string

GetValidationMessageVisibility() public static méthode

Gets the ValidationMessageVisibility property. This dependency property indicates the visibility of the validation message.
public static GetValidationMessageVisibility ( DependencyObject d ) : Visibility
d Windows.UI.Xaml.DependencyObject
Résultat Visibility

SetDefaultErrorMessage() public static méthode

Sets the DefaultErrorMessage property. This dependency property indicates the field value is invalid.
public static SetDefaultErrorMessage ( DependencyObject d, string value ) : void
d Windows.UI.Xaml.DependencyObject
value string
Résultat void

SetFormat() public static méthode

Sets the Format property. This dependency property indicates the formats to validate for.
public static SetFormat ( DependencyObject d, ValidationChecks value ) : void
d Windows.UI.Xaml.DependencyObject
value ValidationChecks
Résultat void

SetInvalidBrush() public static méthode

Sets the InvalidBrush property. This dependency property indicates the brush to use to highlight a field with invalid value.
public static SetInvalidBrush ( DependencyObject d, Brush value ) : void
d Windows.UI.Xaml.DependencyObject
value Windows.UI.Xaml.Media.Brush
Résultat void

SetIsValid() public static méthode

Sets the IsValid property. This dependency property indicates whether the field value is valid.
public static SetIsValid ( DependencyObject d, bool value ) : void
d Windows.UI.Xaml.DependencyObject
value bool
Résultat void

SetMinLength() public static méthode

Sets the MinLength property. This dependency property indicates minimum expected field value length if MinLength format is set.
public static SetMinLength ( DependencyObject d, int value ) : void
d Windows.UI.Xaml.DependencyObject
value int
Résultat void

SetMinLengthErrorMessage() public static méthode

Sets the MinLengthErrorMessage property. This dependency property indicates the error message to use for field that doesn't match minimum length requirement.
public static SetMinLengthErrorMessage ( DependencyObject d, string value ) : void
d Windows.UI.Xaml.DependencyObject
value string
Résultat void

SetNonEmptyErrorMessage() public static méthode

Sets the NonEmptyErrorMessage property. This dependency property indicates the error message to use when the field is marked non-empty and is empty.
public static SetNonEmptyErrorMessage ( DependencyObject d, string value ) : void
d Windows.UI.Xaml.DependencyObject
value string
Résultat void

SetNumericErrorMessage() public static méthode

Sets the NumericErrorMessage property. This dependency property indicates the error message to use for a field marked numeric with non-numeric content.
public static SetNumericErrorMessage ( DependencyObject d, string value ) : void
d Windows.UI.Xaml.DependencyObject
value string
Résultat void

SetPattern() public static méthode

Sets the Pattern property. This dependency property indicates the regex pattern that the Text property needs to match.
public static SetPattern ( DependencyObject d, string value ) : void
d Windows.UI.Xaml.DependencyObject
value string
Résultat void

SetPatternErrorMessage() public static méthode

Sets the PatternErrorMessage property. This dependency property indicates the error message to use when the field text doesn't match requested pattern.
public static SetPatternErrorMessage ( DependencyObject d, string value ) : void
d Windows.UI.Xaml.DependencyObject
value string
Résultat void

SetSpecificLengthErrorMessage() public static méthode

Sets the SpecificLengthErrorMessage property. This dependency property indicates the error message to use for a field with an incorrect number of characters.
public static SetSpecificLengthErrorMessage ( DependencyObject d, string value ) : void
d Windows.UI.Xaml.DependencyObject
value string
Résultat void

SetValidBrush() public static méthode

Sets the ValidBrush property. This dependency property indicates the brush to use to highlight a successfully validated field.
public static SetValidBrush ( DependencyObject d, Brush value ) : void
d Windows.UI.Xaml.DependencyObject
value Windows.UI.Xaml.Media.Brush
Résultat void

SetValidationMessage() public static méthode

Sets the ValidationMessage property. This dependency property indicates the validation error message if the value is not valid.
public static SetValidationMessage ( DependencyObject d, string value ) : void
d Windows.UI.Xaml.DependencyObject
value string
Résultat void

SetValidationMessageVisibility() public static méthode

Sets the ValidationMessageVisibility property. This dependency property indicates the visibility of the validation message.
public static SetValidationMessageVisibility ( DependencyObject d, Visibility value ) : void
d Windows.UI.Xaml.DependencyObject
value Visibility
Résultat void

Property Details

DefaultErrorMessageProperty public_oe static_oe property

DefaultErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml DefaultErrorMessageProperty
Résultat Windows.UI.Xaml.DependencyProperty

FormatProperty public_oe static_oe property

Format Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml FormatProperty
Résultat Windows.UI.Xaml.DependencyProperty

FormatValidationHandlerProperty public_oe static_oe property

FormatValidationHandler Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml FormatValidationHandlerProperty
Résultat Windows.UI.Xaml.DependencyProperty

InvalidBrushProperty public_oe static_oe property

InvalidBrush Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml InvalidBrushProperty
Résultat Windows.UI.Xaml.DependencyProperty

IsValidProperty public_oe static_oe property

IsValid Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml IsValidProperty
Résultat Windows.UI.Xaml.DependencyProperty

MinLengthErrorMessageProperty public_oe static_oe property

MinLengthErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml MinLengthErrorMessageProperty
Résultat Windows.UI.Xaml.DependencyProperty

MinLengthProperty public_oe static_oe property

MinLength Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml MinLengthProperty
Résultat Windows.UI.Xaml.DependencyProperty

NonEmptyErrorMessageProperty public_oe static_oe property

NonEmptyErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml NonEmptyErrorMessageProperty
Résultat Windows.UI.Xaml.DependencyProperty

NumericErrorMessageProperty public_oe static_oe property

NumericErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml NumericErrorMessageProperty
Résultat Windows.UI.Xaml.DependencyProperty

PatternErrorMessageProperty public_oe static_oe property

PatternErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml PatternErrorMessageProperty
Résultat Windows.UI.Xaml.DependencyProperty

PatternProperty public_oe static_oe property

Pattern Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml PatternProperty
Résultat Windows.UI.Xaml.DependencyProperty

SpecificLengthErrorMessageProperty public_oe static_oe property

SpecificLengthErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml SpecificLengthErrorMessageProperty
Résultat Windows.UI.Xaml.DependencyProperty

ValidBrushProperty public_oe static_oe property

ValidBrush Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml ValidBrushProperty
Résultat Windows.UI.Xaml.DependencyProperty

ValidationMessageProperty public_oe static_oe property

ValidationMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml ValidationMessageProperty
Résultat Windows.UI.Xaml.DependencyProperty

ValidationMessageVisibilityProperty public_oe static_oe property

ValidationMessageVisibility Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml ValidationMessageVisibilityProperty
Résultat Windows.UI.Xaml.DependencyProperty