Open sandboxFocus

Class DependencyPropertyNamingConvention

Defines a naming convention for the DependencyPropertyAttribute aspect, specifying how to derive the registration field name, property changed callback, and validation method from the target property name.

Inheritance
DependencyPropertyNamingConvention
Namespace: Metalama.Patterns.Wpf.Configuration
Assembly: Metalama.Patterns.Wpf.dll
Syntax
[CompileTime]
public sealed record DependencyPropertyNamingConvention : ICompileTimeSerializable, IEquatable<DependencyPropertyNamingConvention>
Remarks

Use AddNamingConvention(DependencyPropertyNamingConvention, int?) to register custom naming conventions.

Patterns can use the {PropertyName} placeholder which is replaced with the property name extracted from the target.

Constructors

Name Description
DependencyPropertyNamingConvention(string)

Initializes a new instance of the DependencyPropertyNamingConvention class with the specified name.

Properties

Name Description
IsOnPropertyChangedRequired

Gets or sets a value indicating whether the OnChanged method is required. The default value of this property is true if a value is provided for OnPropertyChangedPattern, otherwise false.

IsValidateRequired

Gets or sets a value indicating whether the Validate method is required. The default value of this property is true if a value is provided for ValidatePattern, otherwise false.

Name

Gets the unique name of this naming convention.

OnPropertyChangedPattern

Gets or sets a regular expression pattern used to identify a method invoked after the property has changed. All occurrences of the substring {PropertyName} will be replaced with the name determined according to PropertyNamePattern before the expression is evaluated. The default value is On{PropertyName}Changed.

PropertyNamePattern

Gets or sets the regular expression pattern that will be evaluated against the name of the target property of the DependencyPropertyAttribute aspect. The expression should yield a match group named Name. If PropertyNamePattern is not specified, the name of the target property is used as the name of the dependency property.

RegistrationFieldName

Gets or sets the name of the registration field to be introduced. The substring {PropertyName} will be replaced with the name as determined according to PropertyNamePattern. The default value is {PropertyName}Property.

ValidatePattern

Gets or sets a regular expression used to identify the method called before the property is changed to perform validation. All occurrences of the substring {PropertyName} will be replaced with the name determined according to PropertyNamePattern before the expression is evaluated. The default value is ^Validate{PropertyName}$.

Methods

Name Description
Equals(DependencyPropertyNamingConvention?)
Equals(object?)
GetHashCode()
ToString()

Operators

Name Description
operator ==(DependencyPropertyNamingConvention?, DependencyPropertyNamingConvention?)
operator !=(DependencyPropertyNamingConvention?, DependencyPropertyNamingConvention?)

Extension Methods

See Also