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
TThe 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
senderobjectThe original sender of the broadcast message.
propertyNamestringThe name of the property that changed.
oldValueTThe value that the property had before the change.
newValueTThe value that the property has after the change.
Exceptions
- ArgumentNullException
Thrown if
senderis 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; }