PostSharp.ILAPI ReferencePost­Sharp.​Patterns.​ModelNotify­Property­Changed­Attribute
Open sandboxFocus

NotifyPropertyChangedAttribute Class

Custom attribute that, when applied on a type, implements the System.ComponentModel.INotifyPropertyChanged interface for this class and all children classes.

Inheritance
NotifyPropertyChangedAttribute
Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model.dll
Syntax
[MulticastAttributeUsage]
[ProvideAspectRole("DataBinding")]
[AspectRoleDependency]
[AspectRoleDependency]
[AspectRoleDependency]
[AspectTypeDependency]
[AspectRoleDependency]
[AspectRoleDependency]
[Metric("UsedFeatures", "PostSharp.Patterns.Model.NotifyPropertyChanged")]
[IntroduceInterface]
[IntroduceInterface]
[IntroduceInterface]
[HasConstraint]
[Serializer]
public sealed class NotifyPropertyChangedAttribute : InstanceLevelAspect, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, ISerializationCallback, INotifyChildPropertyChanged, IAdviceProvider, IAspect, IQueryInterface, IDynamicInterfaceImplementation, ILicensedAspect

Constructors

Name Description
NotifyPropertyChangedAttribute()

Initializes a new instance of the NotifyPropertyChangedAttribute class that stores strong references to the client delegates.

NotifyPropertyChangedAttribute(PortableFormatterConstructorContext)

Fields

Name Description
BaseQueryInterface
LocationBindings
OnChildPropertyChangedMethod
OnChildPropertyChangingMethod
OnPropertyChangedMethod
OnPropertyChangedMethodOriginal
OnPropertyChangingMethod
PropertyLocationBindings
QueryInterfaceMethod

Properties

Name Description
AdvisedObject
ExcludeExplicitProperties

Determines whether the aspect should instrument only automatic properties and ignore any other. This mode allows to use only the abilities of PostSharp Essentials, and prevent the aspect from consuming premium features.

PreventFalsePositives

Determines whether the aspect should do additional efforts to prevent the PropertyChanged event from being raised when the value itself did not change. The default value of this property is false, which means that the aspect will raise the PropertyChanged event whenever any dependency of the property has changed, whether the property value has eventually changed or not. Setting this property to true consumes more memory and processing power because the aspect will need to evaluate the properties and store their value.

WeakEventStrategy

Determines how the PropertyChanged event behaves in terms of keeping weak or strong references.

Methods

Name Description
CompileTimeInitialize(Type, AspectInfo)

Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

CompileTimeValidate(Type)

Method invoked at build time to ensure that the aspect has been applied to the right target.

CreateInstance(AdviceArgs)

Creates a new instance of the aspect based on the current instance, serving as a prototype.

Finalize()

Destructor.

InitializeAspectInstance(AspectInitializationReason)
OnChildPropertyChanged(PropertyPath, Boolean)
OnChildPropertyChanging(PropertyPath, Boolean)
OnCloned(ICloneAwareAspect)

Method called after the an object enhanced by the current aspect has been cloned using System.Object.MemberwiseClone(). The this parameter refers to the new aspect instance in the cloned object.

OnFieldSet<T>(ILocationBinding<T>, Object, T, DeclarationIdentifier)
OnInstanceConstructed()
OnMethodEntry(MethodExecutionArgs)
OnMethodExit(MethodExecutionArgs)
OnMethodResume(MethodExecutionArgs)
OnMethodYield(MethodExecutionArgs)
OnPropertyChanged(String)
OnPropertyGet<T>(ILocationBinding<T>, Object, out T, DeclarationIdentifier)
QueryInterface(Type)
QueryInterface<T>()
RuntimeInitialize(Type)
RuntimeInitializeInstance()

Events

Name Description
ChildPropertyChanged
ChildPropertyChanging
PropertyChanged

Explicit Interface Implementations

Name Description
IAdviceProvider.ProvideAdvices(Object)
ILicensedAspect.GetLicenseRequirements()
ISerializationCallback.OnDeserialized()
ISerializationCallback.OnSerializing()