XamlMemberInvoker.GetValue(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value of the relevant property from an instance.
public:
virtual System::Object ^ GetValue(System::Object ^ instance);
public virtual object GetValue (object instance);
abstract member GetValue : obj -> obj
override this.GetValue : obj -> obj
Public Overridable Function GetValue (instance As Object) As Object
Parameters
- instance
- Object
An instance of the owner type for the member.
Returns
The requested property value.
Exceptions
instance
is null
.
Invoked this method on a XamlMemberInvoker that is based on an unknown XamlMember.
-or-
Invoked this method on a write-only member.
-or-
UnderlyingGetter 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 UnderlyingGetter is null
.
For static properties (IsStatic is true
per UnderlyingGetter) the default implementation calls Invoke(Object, Object[]) on UnderlyingGetter passing null
as the first parameter and packaged instance
in the second. For non-static properties, it calls Invoke(Object, Object[]) and forwards the instance
as the first parameter and an empty package as the second parameter.