PropertyDescriptor<T> class

Namespace Runic.Application.Views · Runic.Application 0.7.0-preview.5

public sealed class PropertyDescriptor<T>

Describes one bridged ViewModel property. Created by generated bridges.

Parameters

name

The .NET property name.

getter

Reads the property value.

setter

Writes the property from browser arguments, or null for a read-only property.

Constructors

PropertyDescriptor

public PropertyDescriptor(string name, Func<T, object?> getter, Action<T, IBridgeArguments>? setter)

Describes one bridged ViewModel property. Created by generated bridges.

Parameters

name

The .NET property name.

getter

Reads the property value.

setter

Writes the property from browser arguments, or null for a read-only property.

PropertyDescriptor

public PropertyDescriptor(string name, Func<T, object?> getter, Action<T, IBridgeArguments>? setter, Func<T, object?> observe)

Describes a property whose value comes from an observed sub-object, such as a navigation region slot.

Parameters

name

The .NET property name.

getter

Reads the property's wire value.

setter

Writes the property from browser arguments, or null for a read-only property.

observe

Returns the sub-object the Bridge observes for this property. The Bridge subscribes when it is created and again when the ViewModel reports a change, and publishes when the sub-object changes. A NavigationRegion publishes when its Current changes and binds the window session as its navigator's presentation; another INotifyPropertyChanged publishes on every change.

Properties

CanWrite

public bool CanWrite { get; }

Whether the browser may write the property.

Name

public string Name { get; }

The .NET property name.

Methods

Get

public object? Get(T vm)

Reads the property value from vm.