Class INotifyPropertyChangedExtensions
Extension methods for INotifyPropertyChanged.
Inherited Members
Namespace: Phoenix.BotBrain.Extensions
Assembly: Phoenix.Plugin.BotBrain.Shared.dll
Syntax
public static class INotifyPropertyChangedExtensions
Methods
View SourceOnPropertyChanged(INotifyPropertyChanged, string, Action)
Sets up a trigger for an action whenever the given property changes.
Declaration
public static PropertyChangedEventHandler OnPropertyChanged(this INotifyPropertyChanged self, string propertyName, Action action)
Parameters
Type | Name | Description |
---|---|---|
INotifyPropertyChanged | self | The object being extended. |
string | propertyName | The property name. |
Action | action | The trigger action. |
Returns
Type | Description |
---|---|
PropertyChangedEventHandler | The event handler. |
OnPropertyChanged(INotifyPropertyChanged, string, Action<object?, string>)
Sets up a trigger for an action whenever the given property changes.
Declaration
public static PropertyChangedEventHandler OnPropertyChanged(this INotifyPropertyChanged self, string propertyName, Action<object?, string> action)
Parameters
Type | Name | Description |
---|---|---|
INotifyPropertyChanged | self | The object being extended. |
string | propertyName | The property name. |
Action<object, string> | action | The trigger action, which has arguments for the changed object and property. |
Returns
Type | Description |
---|---|
PropertyChangedEventHandler | The event handler. |
OnPropertyChangedUntil(INotifyPropertyChanged, string, Func<bool>)
Sets up a trigger for an action whenever the given property changes.
Declaration
public static PropertyChangedEventHandler OnPropertyChangedUntil(this INotifyPropertyChanged self, string propertyName, Func<bool> trigger)
Parameters
Type | Name | Description |
---|---|---|
INotifyPropertyChanged | self | The object being extended. |
string | propertyName | The property name. |
Func<bool> | trigger | The trigger action, which may return true to unsubscribe. |
Returns
Type | Description |
---|---|
PropertyChangedEventHandler | The event handler. |
OnPropertyChangedUntil(INotifyPropertyChanged, string, Func<object?, string, bool>)
Sets up a trigger for an action whenever the given property changes.
Declaration
public static PropertyChangedEventHandler OnPropertyChangedUntil(this INotifyPropertyChanged self, string propertyName, Func<object?, string, bool> trigger)
Parameters
Type | Name | Description |
---|---|---|
INotifyPropertyChanged | self | The object being extended. |
string | propertyName | The property name. |
Func<object, string, bool> | trigger | The trigger action, which may return true to unsubscribe, and has arguments for the changed object and property. |
Returns
Type | Description |
---|---|
PropertyChangedEventHandler | The event handler. |