Class INotifyPropertyChangedAttribute
- Namespace
- CommunityToolkit.Mvvm.ComponentModel
- Assembly
- CommunityToolkit.Mvvm.dll
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...
}
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class INotifyPropertyChangedAttribute : Attribute
- Inheritance
-
INotifyPropertyChangedAttribute
- Inherited Members
Constructors
INotifyPropertyChangedAttribute()
public 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>(ref 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.
public bool IncludeAdditionalHelperMethods { get; init; }