Edit

Share via


INotifyPropertyChangedAttribute Class

Definition

An attribute that indicates that a given type should implement the INotifyPropertyChanged interface and have minimal built-in functionality to support it. This includes exposing the necessary event and having two methods to raise it that mirror OnPropertyChanged(PropertyChangedEventArgs) and OnPropertyChanged(String). For more extensive support, use ObservableObjectAttribute.

This attribute can be used as follows:

[INotifyPropertyChanged]
partial class MyViewModel : SomeOtherClass
{
    // Other members here...
}

[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
public sealed class INotifyPropertyChangedAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)>]
type INotifyPropertyChangedAttribute = class
    inherit Attribute
Public NotInheritable Class INotifyPropertyChangedAttribute
Inherits Attribute
Inheritance
INotifyPropertyChangedAttribute
Attributes

Constructors

INotifyPropertyChangedAttribute()

Properties

IncludeAdditionalHelperMethods

Gets or sets a value indicating whether or not to also generate all the additional helper methods that are found in ObservableObject as well (eg. SetProperty<T>(T, T, String). If set to false, only the PropertyChanged event and the two OnPropertyChanged(PropertyChangedEventArgs) overloads will be generated. The default value is true.

Applies to