public sealed class PropertyDescriptor Describes one bridged ViewModel property. Created by generated bridges.
Constructors
PropertyDescriptor
public PropertyDescriptor(string name, string wireName, Func<object, object?> getter, Action<object, JsonElement>? setter) Describes a property whose setter reads the value of a set request.
Parameters
nameThe .NET property name.
wireNameThe member's wire name in state.
getterReads the property value.
setterWrites the property from the request's
value, ornullfor a read-only property. It throwsFormatException,JsonException,ArgumentExceptionorOverflowExceptionfor a value that is not valid input.
PropertyDescriptor
public PropertyDescriptor(string name, string wireName, Func<object, object?> getter, Action<object, JsonElement>? setter, Func<object, object?> observe) Describes a property whose value comes from an observed sub-object, such as a navigation region slot.
Parameters
nameThe .NET property name.
wireNameThe member's wire name in state.
getterReads the property's wire value.
setterWrites the property from the request's
value, ornullfor a read-only property.observeReturns the sub-object the Bridge observes for this property. The Bridge subscribes when it is created, again when the ViewModel reports a change of this property or of every property, and before the publication unit that follows a change of another property; it publishes when the sub-object changes. A
NavigationRegionpublishes when itsCurrentchanges and binds the window session as its navigator's presentation; aNavigationSelectionpublishes when itsSelectedIndexchanges, and for aPropertyDescriptor.RegionCollectionalso when its regions or theirCurrentchange; anotherINotifyPropertyChangedpublishes on every change.
Properties
AppendOnlyTextField
public string? AppendOnlyTextField { get; init; } The wire name of a RunicAppendOnlyTextAttribute property whose appended text the Bridge publishes as a frame, or null. PropertyDescriptor.Get returns its String value.
CanWrite
public bool CanWrite { get; } Whether the browser may write the property.
Name
public string Name { get; } The .NET property name.
QueryRowWriter
public Action<Utf8JsonWriter, object?>? QueryRowWriter { get; init; } Writes one row of a RunicQueryCollection property, whose rows a page reads with query-rows (query-collections/1); null for any other property. PropertyDescriptor.Get returns the collection.
RegionClose
public bool RegionClose { get; init; } Whether a region request of a PropertyDescriptor.RegionCollection property may close a region.
RegionCollection
public bool RegionCollection { get; init; } Whether the property is a region collection (RunicRegionCollectionAttribute): its observed sub-object is a NavigationSelection whose regions and their content the Bridge observes, and whose regions the page selects with region requests (region-collections/1).
TextMember
public bool TextMember { get; init; } Whether the property is a text member: a String state member that frames and set requests may change with text splices on connections that use text-splice/1. PropertyDescriptor.Get returns its String value.
TextSetter
public Action<object, string>? TextSetter { get; init; } Writes a text member from the value a set request's splice produces, or from a set request's string value; null for a read-only property. It throws like the setter.
WireName
public string WireName { get; } The member's wire name in state.
Methods
Get
public object? Get(object vm) Reads the property value from vm.