PostSharpAPI ReferencePost­Sharp.​Patterns.​XamlAttached­Property­Attribute
Open sandboxFocus

AttachedPropertyAttribute Class

Custom attribute that, when applied on a static automatic property and of type Attached<T> turns this property into a XAML dependency property of the same name and whose value type is T.

Namespace: PostSharp.Patterns.Xaml
Assembly: PostSharp.Patterns.Xaml.dll
Syntax
[HasConstraint]
[Serializer]
public sealed class AttachedPropertyAttribute : DependencyPropertyBaseAttribute, ILocationLevelAspect, ILocationLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, IAspectProvider, IAspect, IService, ILocationValidationHandler
Remarks

Supposed the target property is named Foo. If a method named ValidateFoo exists in the class, it will be used to validate the values assigned to this property. If a method named OnFooChanged exists in the class, it will be invoked whenever the property set. If a property named FooProperty exists in the class, it will be assigned to the corresponding DependencyProperty instance. Naming conventions can be overridden by the ValidateValueMethod, PropertyChangedMethod and RegistrationProperty aspect properties.

Constructors

Name Description
AttachedPropertyAttribute()
AttachedPropertyAttribute(PortableFormatterConstructorContext)

Properties

Name Description
SupportsRegistrationProperties

Methods

Name Description
CompileTimeValidate(LocationInfo)
GetPropertyName()
GetPropertyType()
OnPropertyGet<T>(out T, ILocationBinding)
OnPropertySet<T>(T)
RegisterProperty(Type, Type)
ValidateChangeHandlerSignature(MethodInfo, LocationInfo, String)
ValidateValidatorSignature(MethodInfo, LocationInfo, String)