ObservableObject.SetProperty Method

Definition

Overloads

SetProperty(IntPtr, IntPtr, String)
SetProperty(UIntPtr, UIntPtr, String)
SetProperty<T>(T, T, String)

Checks for a change to a value, and if the value is different, stores the value and notifies of property changes.

SetProperty<T>(T, T, Action, String)

Checks for a change to a value, and if the value is different, stores the value and notifies of property changes.

SetProperty<T>(T, T, Action<T,T>, String)

Checks for a change to a value, and if the value is different, stores the value and notifies of property changes.

SetProperty(IntPtr, IntPtr, String)

C#
protected bool SetProperty(ref IntPtr field, IntPtr newValue, string propertyName = default);

Parameters

field
IntPtr
newValue
IntPtr
propertyName
String

Returns

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022

SetProperty(UIntPtr, UIntPtr, String)

C#
protected bool SetProperty(ref UIntPtr field, UIntPtr newValue, string propertyName = default);

Parameters

field
UIntPtr
newValue
UIntPtr
propertyName
String

Returns

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022

SetProperty<T>(T, T, String)

Checks for a change to a value, and if the value is different, stores the value and notifies of property changes.

C#
protected bool SetProperty<T>(ref T field, T newValue, string propertyName = default);

Type Parameters

T

The type of field changing.

Parameters

field
T

The storage location for the field behind the property.

newValue
T

The new value to store in the field.

propertyName
String

The property name to notify of changes if the values are different.

Returns

True if the property value was changed.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022

SetProperty<T>(T, T, Action, String)

Checks for a change to a value, and if the value is different, stores the value and notifies of property changes.

C#
protected bool SetProperty<T>(ref T field, T newValue, Action beforeNotifyAction, string propertyName = default);

Type Parameters

T

The type of field changing.

Parameters

field
T

The storage location for the field behind the property.

newValue
T

The new value to store in the field.

beforeNotifyAction
Action

An action to call if the value changes, before notifying property changes.

propertyName
String

The property name to notify of changes if the values are different.

Returns

True if the property value was changed.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022

SetProperty<T>(T, T, Action<T,T>, String)

Checks for a change to a value, and if the value is different, stores the value and notifies of property changes.

C#
protected bool SetProperty<T>(ref T field, T newValue, Action<T,T> beforeNotifyAction, string propertyName = default);

Type Parameters

T

The type of field changing.

Parameters

field
T

The storage location for the field behind the property.

newValue
T

The new value to store in the field.

beforeNotifyAction
Action<T,T>

An action to call if the value changes, before notifying property changes.

propertyName
String

The property name to notify of changes if the values are different.

Returns

True if the property value was changed.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022