Table of Contents

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 object

The original sender of the broadcast message.

propertyName string

The name of the property that changed.

oldValue T

The value that the property had before the change.

newValue T

The 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

string

Sender

Gets the original sender of the broadcast message.

public object Sender { get; }

Property Value

object