Class PropertyChangedMessage<T>
- Namespace
- CommunityToolkit.Mvvm.Messaging.Messages
- Assembly
- CommunityToolkit.Mvvm.dll
A message used to broadcast property changes in observable objects.
public class PropertyChangedMessage<T>
Type Parameters
T
The type of the property to broadcast the change for.
- Inheritance
-
PropertyChangedMessage<T>
- Inherited Members
Constructors
PropertyChangedMessage(object, string?, T, T)
Initializes a new instance of the PropertyChangedMessage<T> class.
public PropertyChangedMessage(object sender, string? propertyName, T oldValue, T newValue)
Parameters
sender
objectThe original sender of the broadcast message.
propertyName
stringThe name of the property that changed.
oldValue
TThe value that the property had before the change.
newValue
TThe value that the property has after the change.
Exceptions
- ArgumentNullException
Thrown if
sender
is null.
Properties
NewValue
Gets the value that the property has after the change.
public T NewValue { get; }
Property Value
- T
OldValue
Gets the value that the property had before the change.
public T OldValue { get; }
Property Value
- T
PropertyName
Gets the name of the property that changed.
public string? PropertyName { get; }
Property Value
Sender
Gets the original sender of the broadcast message.
public object Sender { get; }