BindableObject.SetValue Method

Definition

Overloads

SetValue(BindableProperty, Object)

Sets the value of the specified bindable property.

SetValue(BindablePropertyKey, Object)

Sets the value of the specified bindable property.

SetValue(BindableProperty, Object)

Source:
BindableObject.cs
Source:
BindableObject.cs

Sets the value of the specified bindable property.

public void SetValue (Microsoft.Maui.Controls.BindableProperty property, object value);

Parameters

property
BindableProperty

The bindable property on which to assign a value.

value
Object

The value to set.

Exceptions

Thrown when property is null.

Remarks

If property is read-only, nothing will happen.

Applies to

.NET MAUI 9 and .NET MAUI 8
Product Versions
.NET MAUI 8, 9

SetValue(BindablePropertyKey, Object)

Source:
BindableObject.cs
Source:
BindableObject.cs

Sets the value of the specified bindable property.

public void SetValue (Microsoft.Maui.Controls.BindablePropertyKey propertyKey, object value);

Parameters

propertyKey
BindablePropertyKey

The key that identifies the bindable property to assign the value to.

value
Object

The value to set.

Exceptions

Thrown when propertyKey is null.

Thrown when the bindable property identified by propertyKey is read-only.

Applies to

.NET MAUI 9 and .NET MAUI 8
Product Versions
.NET MAUI 8, 9