ViewModelBridge class

Namespace Runic.Application.Views.Generated in Runic.Application.Views 0.23.0

public class ViewModelBridge : IDisposable

Inherits or implements IDisposable.

Base class of generated bridges that expose one ViewModel over an IBridgeTransport.

Remarks

A Bridge serves its route of the Views protocol 4 (specs/application/README.md): the requests in BridgeRuntime.Requests.cs, the publication of its state in BridgeRuntime.Publication.cs, and the operation and interaction requests in BridgeRuntime.Operations.cs.

Constructors

ViewModelBridge

protected ViewModelBridge(IBridgeTransport transport, INotifyPropertyChanged vm, Type modelType, string name, BridgeStateMember[] state, PropertyDescriptor[] properties, CheckedPropertyDescriptor[] checkedProperties, CommandDescriptor[] commands, string? contractFingerprint = null, WindowContentSession? content = null, BridgeInteractionDescriptor[]? interactions = null, BridgeDataSubscriptionMember[]? dataSubscriptions = null, BridgeCollectionDescriptor[]? collections = null, BridgeValidationReader? validationReader = null)

Creates the Bridge of a ViewModel whose state is written member by member.

Parameters

transport

The window's transport.

vm

The ViewModel.

modelType

The ViewModel's declared type, which names it in the contract, logs and telemetry; the generated Bridge passes typeof of its ViewModel.

name

The route name.

state

Every state member, in state order.

properties

The bridged properties.

checkedProperties

The properties with acknowledged field writes, if any.

commands

The bridged commands.

contractFingerprint

The generated contract fingerprint.

content

The window's content session.

interactions

The View's interactions.

dataSubscriptions

The data graph the Bridge observes.

collections

The keyed collections.

validationReader

Reads and observes the validation the ViewModel and its data graph keep outside INotifyDataErrorInfo, such as a ReactiveUI.Validation ValidationContext, or null. A change it observes publishes the state; checked writes report the messages it reads for their member in applied.validation.

Methods

Dispose

public virtual void Dispose()

Stops serving the Bridge's route and observing the ViewModel.