XamlMemberInvoker.SetValue(Object, Object) Method


Sets a value of the relevant property on an instance.

 virtual void SetValue(System::Object ^ instance, System::Object ^ value);
public virtual void SetValue (object instance, object value);
abstract member SetValue : obj * obj -> unit
override this.SetValue : obj * obj -> unit
Public Overridable Sub SetValue (instance As Object, value As Object)



An instance of the owner type for the member.


The property value to set.


instance is null.

Invoked this method on a XamlMemberInvoker that is based on an unknown XamlMember.


Invoked this method on a read-only member.


UnderlyingSetter is null.

Notes to Inheritors

The base implementation includes a call to the internal helper ThrowIfUnknown. This helper always throws for cases where a XamlMemberInvoker is based on an unknown XamlMember, which includes cases where the UnderlyingMember of the XamlMember is null.

The base implementation throws if UnderlyingSetter is null.

For static properties (IsStatic is true per UnderlyingSetter) the default implementation calls Invoke(Object, Object[]) on UnderlyingSetter passing null as the first parameter and packaging instance and value as the second parameter. For non-static properties, it calls Invoke(Object, Object[]) and forwards instance as first parameter and value as second parameter.

Applies to