Skip to content

Interface IObjectDescriptor

Definition

Namespace: StardewUI.Framework.Descriptors
Assembly: StardewUI.dll

Describes a type of object that participates in view binding, either as the target or the source.

public interface IObjectDescriptor

Remarks

The binding target is independent of the actual object instance; it provides methods and data to support interacting with any object of the given TargetType.

Members

Properties

Name Description
MemberNames Enumerates the names of all members of the object type.
SupportsChangeNotifications Whether or not objects of this type can notify about data changes; that is, if the type implements INotifyPropertyChanged.
TargetType The type being described, which owns or inherits each of the available members.

Methods

Name Description
GetEvent(string) Retrieves a named event on the TargetType.
GetMethod(string) Retrieves a named method of the TargetType.
GetProperty(string) Retrieves a named property of the TargetType.
TryGetEvent(string, IEventDescriptor) Attempts to retrieve a named event on the TargetType.
TryGetMethod(string, IMethodDescriptor) Attempts to retrieve a named method of the TargetType.
TryGetProperty(string, IPropertyDescriptor) Attempts to retrieve a named property of the TargetType.

Details

Properties

MemberNames

Enumerates the names of all members of the object type.

System.Collections.Generic.IEnumerable<string> MemberNames { get; }
Property Value

IEnumerable<string>


SupportsChangeNotifications

Whether or not objects of this type can notify about data changes; that is, if the type implements INotifyPropertyChanged.

bool SupportsChangeNotifications { get; }
Property Value

Boolean


TargetType

The type being described, which owns or inherits each of the available members.

System.Type TargetType { get; }
Property Value

Type


Methods

GetEvent(string)

Retrieves a named event on the TargetType.

StardewUI.Framework.Descriptors.IEventDescriptor GetEvent(string name);
Parameters

name   string
The event name.

Returns

IEventDescriptor

The IEventDescriptor whose Name is name.


GetMethod(string)

Retrieves a named method of the TargetType.

StardewUI.Framework.Descriptors.IMethodDescriptor GetMethod(string name);
Parameters

name   string
The method name.

Returns

IMethodDescriptor

The IMethodDescriptor whose Name is name.

Remarks

Overloaded methods are not supported. If different signatures are required, use optional parameters.


GetProperty(string)

Retrieves a named property of the TargetType.

StardewUI.Framework.Descriptors.IPropertyDescriptor GetProperty(string name);
Parameters

name   string
The property name.

Returns

IPropertyDescriptor

The IPropertyDescriptor whose Name is name.


TryGetEvent(string, IEventDescriptor)

Attempts to retrieve a named event on the TargetType.

bool TryGetEvent(string name, out StardewUI.Framework.Descriptors.IEventDescriptor event);
Parameters

name   string
The event name.

event   IEventDescriptor
When this method returns, holds a reference to the IEventDescriptor whose Name is name, or null if no event was found with the given name.

Returns

Boolean

true if the named event was found, otherwise false.


TryGetMethod(string, IMethodDescriptor)

Attempts to retrieve a named method of the TargetType.

bool TryGetMethod(string name, out StardewUI.Framework.Descriptors.IMethodDescriptor method);
Parameters

name   string
The method name.

method   IMethodDescriptor
When this method returns, holds a reference to the IMethodDescriptor whose Name is name, or null if no method was found with the given name.

Returns

Boolean

true if the named method was found, otherwise false.

Remarks

Overloaded methods are not supported. If different signatures are required, use optional parameters.


TryGetProperty(string, IPropertyDescriptor)

Attempts to retrieve a named property of the TargetType.

bool TryGetProperty(string name, out StardewUI.Framework.Descriptors.IPropertyDescriptor property);
Parameters

name   string
The property name.

property   IPropertyDescriptor
When this method returns, holds a reference to the IPropertyDescriptor whose Name is name, or null if no property was found with the given name.

Returns

Boolean

true if the named property was found, otherwise false.