NotifyPropertyChangedInvocatorAttribute - конструктор
Indicates that the method is contained in a type that implements
INotifyPropertyChanged interface
and this method is used to notify that some property value changed.
Пространство имён: Tessa.Properties.ResharperСборка: Tessa (в Tessa.dll) Версия: 4.1.3+7e2b1422f9b8c7c41fbbc4b151a843bed05319ab
public NotifyPropertyChangedInvocatorAttribute(
string? parameterName = null
)
Public Sub New (
Optional parameterName As String = Nothing
)
public:
NotifyPropertyChangedInvocatorAttribute(
String^ parameterName = nullptr
)
new :
?parameterName : string
(* Defaults:
let _parameterName = defaultArg parameterName null
*)
-> NotifyPropertyChangedInvocatorAttribute
Параметры
- parameterName String (Optional)
-
The parameter name.
The method should be non-static and conform to one of the supported signatures:
- NotifyChanged(string)
- NotifyChanged(params string[])
- NotifyChanged{T}(Expression{Func{T}})
- NotifyChanged{T,U}(Expression{Func{T,U}})
- SetProperty{T}(ref T, T, string)
public class Foo : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void NotifyChanged(string propertyName)
{}
private string _name;
public string Name
{
get { return _name; }
set
{
_name = value;
NotifyChanged("LastName"); // Warning
}
}
}
Examples of generated notifications:
- NotifyChanged("Property")
- NotifyChanged(() => Property)
- NotifyChanged((VM x) => x.Property)
- SetProperty(ref myField, value, "Property")