Class MarkupMember
- Namespace
- Icy.Markup
- Assembly
- IcyUI.dll
A property the loader can read or write, resolved either through the property registry or through plain reflection.
public sealed class MarkupMember
- Inheritance
-
MarkupMember
- Inherited Members
- Extension Methods
Remarks
Markup needs both paths. A registered property (RegisterReferenceAttribute) is preferred, because writing through its IPropertyReference puts the value into the same precedence system styles, visual states, and animations use - a markup-assigned value is a local one and outranks all of them, exactly as a code-assigned value does.
But the registry only ever contains writable properties of types that opted in, and markup has to reach two kinds of property it therefore never sees: read-only collections that content and property elements populate (Children, ColumnDefinitions), and plain data objects that are not DependencyObjects at all (Width). Those resolve to a PropertyInfo instead.
Properties
CanSet
Gets a value indicating whether this property can be assigned to.
public bool CanSet { get; }
Property Value
Remarks
A read-only collection property is readable but not settable - it is populated by adding to the collection it already holds.
IsRegistered
Gets a value indicating whether writes go through the property registry rather than plain reflection.
public bool IsRegistered { get; }
Property Value
Name
Gets the property's name.
public string Name { get; }
Property Value
PropertyType
Gets the property's declared type.
public Type PropertyType { get; }
Property Value
Reference
Gets the registered property reference, when IsRegistered is true.
public IPropertyReference? Reference { get; }
Property Value
Remarks
Exposed for callers that need the reference itself rather than the get/set indirection this class provides - BindingExtension is the reason this exists, since Binding binds against an IPropertyReference, not a name.
Methods
EnumerateNames(Type, PropertyRegistry)
Enumerates the names markup could have meant on targetType, for error suggestions.
public static IEnumerable<string> EnumerateNames(Type targetType, PropertyRegistry registry)
Parameters
targetTypeTypeThe type whose properties should be listed.
registryPropertyRegistryThe registry to enumerate registered properties from.
Returns
- IEnumerable<string>
Every settable public property name, registered or not.
FromReference(IPropertyReference)
Wraps an already-resolved IPropertyReference as a MarkupMember.
public static MarkupMember FromReference(IPropertyReference reference)
Parameters
referenceIPropertyReferenceThe property reference to wrap.
Returns
- MarkupMember
A member that writes through
reference.
Remarks
Lets attached-property assignment (which already has the reference from a qualified lookup) share the same value-assignment path - markup extensions included - as an ordinary named property.
GetValue(object)
Reads the property's current value from target.
public object? GetValue(object target)
Parameters
targetobjectThe object to read from.
Returns
- object
The current value.
Resolve(Type, string, PropertyRegistry)
Resolves a property on targetType, preferring a registered one.
public static MarkupMember? Resolve(Type targetType, string name, PropertyRegistry registry)
Parameters
targetTypeTypeThe type declaring the property.
namestringThe property's name.
registryPropertyRegistryThe registry to resolve registered properties through.
Returns
- MarkupMember
The resolved property, or null when the type has no such public property.
SetValue(object, object?)
Assigns value to the property on target.
public void SetValue(object target, object? value)
Parameters
Exceptions
- InvalidOperationException
The property has no setter.