-
-
Notifications
You must be signed in to change notification settings - Fork 227
Attributes
Simon Cropp edited this page May 27, 2017
·
8 revisions
Deprecated as of version 2. Instead add INotifyPropertyChanged
to the target class.
Allows the injection of notify code that points to a different property.
For example
public class Person : INotifyPropertyChanged
{
[AlsoNotifyFor("FullName")]
public string GivenName { get; set; }
[AlsoNotifyFor("FullName")]
public string FamilyName { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public string FullName { get; set; }
}
Use this attribute to exclude a property or type from having notification injected.
For Example
public class Person : INotifyPropertyChanged
{
public string GivenName { get; set; }
[DoNotNotify]
public string FamilyName { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
}
Injects this property to be notified when a dependent property is set.
For Example
public class Person : INotifyPropertyChanged
{
public string GivenName { get; set; }
public string FamilyName { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
[DependsOn("GivenName","FamilyName")]
public string FullName { get; set; }
}
Used to ignore IsChanged
for a given property.
For Example below IsChanged
will not be called when FullName
is set.
public class Person: INotifyPropertyChanged
{
[DoNotSetChanged]
public string FullName { get; set; }
public bool IsChanged { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
}
Used to skip equality check for a given property.