Struct PropertyPath.PathSegment
Represents a segment of the PropertyPath.
protected readonly struct PropertyPath.PathSegment
- Inherited Members
- Extension Methods
Fields
Params
Gets the parameters to call the indexer.
public readonly object?[]? Params
Field Value
- object[]
Property
Gets the property info to get the value from.
public readonly PropertyInfo? Property
Field Value
Reference
Gets the registered property reference to get the value from, when the target type has one.
public readonly IPropertyReference? Reference
Field Value
Remarks
Set for properties registered through PropertyRegistry (see RegisterReferenceAttribute), so that binding through a path segment participates in the same value-precedence system as styles, visual states, and animations. Falls back to Property for everything else, including plain BCL types that were never registered.
ResultType
Gets the type of the calculation result.
public readonly Type ResultType
Field Value
Properties
IsArray
Gets a value indicating whether the target type is an array.
[MemberNotNullWhen(true, "Params")]
public bool IsArray { get; init; }
Property Value
IsReadOnly
Gets a value indicating whether the path segment can't be assigned to.
public bool IsReadOnly { get; init; }
Property Value
Methods
FromIndexer(Type, string[])
Gets an indexer call segment.
public static PropertyPath.PathSegment FromIndexer(Type target, string[] arguments)
Parameters
targetTypeTarget type to call the indexer for.
argumentsstring[]Array of arguments to access the indexer for.
Returns
- PropertyPath.PathSegment
An instance of the PropertyPath.PathSegment struct for the indexer access.
FromProperty(Type, string, PropertyRegistry?)
Gets a property call segment.
public static PropertyPath.PathSegment FromProperty(Type target, string propertyName, PropertyRegistry? registry = null)
Parameters
targetTypeTarget type to get the property for.
propertyNamestringA property name to search the property.
registryPropertyRegistryThe registry to resolve a registered property through, or null to use Current.
Returns
- PropertyPath.PathSegment
An instance of the PropertyPath.PathSegment struct for the property access.
GetValue(object)
Gets the value of an object for the current path segment.
public object? GetValue(object obj)
Parameters
objobjectAn object to get the value from.
Returns
- object
Value of the defined property of the specified object.
SetValue(object, object?)
Sets the value of an object for the current path segment.
public void SetValue(object target, object? value)