Class CorePropertyChanged
Represents a basic bindable class which notifies when a property value changes.
Inheritance
Namespace: Artemis.Core
Assembly: Artemis.Core.dll
Syntax
public abstract class CorePropertyChanged : INotifyPropertyChanged
Methods
| Improve this Doc View SourceOnPropertyChanged(String)
Triggers the PropertyChanged-event when a a property value has changed.
Declaration
protected virtual void OnPropertyChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property used to notify listeners. This value is optional and can be provided automatically when invoked from compilers that support System.Runtime.CompilerServices.CallerMemberNameAttribute . |
RequiresUpdate<T>(ref T, T)
Checks if the property already matches the desirec value or needs to be updated.
Declaration
protected virtual bool RequiresUpdate<T>(ref T storage, T value)
Parameters
Type | Name | Description |
---|---|---|
T | storage | Reference to the backing-filed. |
T | value | Value to apply. |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
T | Type of the property. |
SetAndNotify<T>(ref T, T, String)
Checks if the property already matches the desired value and updates it if not.
Declaration
[NotifyPropertyChangedInvocator]
protected virtual bool SetAndNotify<T>(ref T storage, T value, string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
T | storage | Reference to the backing-filed. |
T | value | Value to apply. |
System.String | propertyName | Name of the property used to notify listeners. This value is optional and can be provided automatically when invoked from compilers that support System.Runtime.CompilerServices.CallerMemberNameAttribute . |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T | Type of the property. |
Events
| Improve this Doc View SourcePropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |