Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SetPropertyHelper.Set<T>(ref T, T, Action<T>) Method

Updates the field value if the new value is different. The method invokes the specified callback if the field value changes.

Namespace: DevExpress.Maui.Mvvm

Assembly: DevExpress.Maui.Mvvm.dll

NuGet Package: DevExpress.Maui.Mvvm

#Declaration

C#
public static bool Set<T>(
    ref T storage,
    T value,
    Action<T> changedCallback
)

#Parameters

Name Type Description
storage T

A reference to the target field.

value T

The new field value.

changedCallback Action<T>

A callback that invokes if the underlying value changes. The callback accepts the old field value.

#Type Parameters

Name Description
T

The type of the target field.

#Returns

Type Description
Boolean

true if the method updates the field value in the storage; otherwise, false.

See Also