C# Класс WinRTXamlToolkit.Controls.Extensions.FieldValidationExtensions

Attached properties for handling basic validation of field values.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

GetDefaultErrorMessage() публичный статический Метод

Gets the DefaultErrorMessage property. This dependency property indicates the field value is invalid.
public static GetDefaultErrorMessage ( DependencyObject d ) : string
d Windows.UI.Xaml.DependencyObject
Результат string

GetFormat() публичный статический Метод

Gets the Format property. This dependency property indicates the formats to validate for.
public static GetFormat ( DependencyObject d ) : ValidationChecks
d Windows.UI.Xaml.DependencyObject
Результат ValidationChecks

GetInvalidBrush() публичный статический Метод

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
Результат Windows.UI.Xaml.Media.Brush

GetIsValid() публичный статический Метод

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
Результат bool

GetMinLength() публичный статический Метод

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
Результат int

GetMinLengthErrorMessage() публичный статический Метод

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
Результат string

GetNonEmptyErrorMessage() публичный статический Метод

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
Результат string

GetNumericErrorMessage() публичный статический Метод

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
Результат string

GetPattern() публичный статический Метод

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
Результат string

GetPatternErrorMessage() публичный статический Метод

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
Результат string

GetSpecificLengthErrorMessage() публичный статический Метод

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
Результат string

GetValidBrush() публичный статический Метод

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
Результат Windows.UI.Xaml.Media.Brush

GetValidationMessage() публичный статический Метод

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
Результат string

GetValidationMessageVisibility() публичный статический Метод

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
Результат Visibility

SetDefaultErrorMessage() публичный статический Метод

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
Результат void

SetFormat() публичный статический Метод

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
Результат void

SetInvalidBrush() публичный статический Метод

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
Результат void

SetIsValid() публичный статический Метод

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
Результат void

SetMinLength() публичный статический Метод

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
Результат void

SetMinLengthErrorMessage() публичный статический Метод

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
Результат void

SetNonEmptyErrorMessage() публичный статический Метод

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
Результат void

SetNumericErrorMessage() публичный статический Метод

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
Результат void

SetPattern() публичный статический Метод

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
Результат void

SetPatternErrorMessage() публичный статический Метод

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
Результат void

SetSpecificLengthErrorMessage() публичный статический Метод

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
Результат void

SetValidBrush() публичный статический Метод

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
Результат void

SetValidationMessage() публичный статический Метод

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
Результат void

SetValidationMessageVisibility() публичный статический Метод

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
Результат void

Описание свойств

DefaultErrorMessageProperty публичное статическое свойство

DefaultErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml DefaultErrorMessageProperty
Результат Windows.UI.Xaml.DependencyProperty

FormatProperty публичное статическое свойство

Format Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml FormatProperty
Результат Windows.UI.Xaml.DependencyProperty

FormatValidationHandlerProperty публичное статическое свойство

FormatValidationHandler Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml FormatValidationHandlerProperty
Результат Windows.UI.Xaml.DependencyProperty

InvalidBrushProperty публичное статическое свойство

InvalidBrush Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml InvalidBrushProperty
Результат Windows.UI.Xaml.DependencyProperty

IsValidProperty публичное статическое свойство

IsValid Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml IsValidProperty
Результат Windows.UI.Xaml.DependencyProperty

MinLengthErrorMessageProperty публичное статическое свойство

MinLengthErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml MinLengthErrorMessageProperty
Результат Windows.UI.Xaml.DependencyProperty

MinLengthProperty публичное статическое свойство

MinLength Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml MinLengthProperty
Результат Windows.UI.Xaml.DependencyProperty

NonEmptyErrorMessageProperty публичное статическое свойство

NonEmptyErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml NonEmptyErrorMessageProperty
Результат Windows.UI.Xaml.DependencyProperty

NumericErrorMessageProperty публичное статическое свойство

NumericErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml NumericErrorMessageProperty
Результат Windows.UI.Xaml.DependencyProperty

PatternErrorMessageProperty публичное статическое свойство

PatternErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml PatternErrorMessageProperty
Результат Windows.UI.Xaml.DependencyProperty

PatternProperty публичное статическое свойство

Pattern Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml PatternProperty
Результат Windows.UI.Xaml.DependencyProperty

SpecificLengthErrorMessageProperty публичное статическое свойство

SpecificLengthErrorMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml SpecificLengthErrorMessageProperty
Результат Windows.UI.Xaml.DependencyProperty

ValidBrushProperty публичное статическое свойство

ValidBrush Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml ValidBrushProperty
Результат Windows.UI.Xaml.DependencyProperty

ValidationMessageProperty публичное статическое свойство

ValidationMessage Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml ValidationMessageProperty
Результат Windows.UI.Xaml.DependencyProperty

ValidationMessageVisibilityProperty публичное статическое свойство

ValidationMessageVisibility Attached Dependency Property
public static DependencyProperty,Windows.UI.Xaml ValidationMessageVisibilityProperty
Результат Windows.UI.Xaml.DependencyProperty