ReactiveInteractionDescriptor class

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

public static class ReactiveInteractionDescriptor

Factory used by generated ReactiveUI bridges to expose one typed interaction to a mounted browser endpoint. It deliberately registers one ReactiveUI handler per Interaction object, regardless of how many views or windows present that object.

Methods

Create

public static BridgeInteractionDescriptor Create<TInput, TOutput>(string name, string contract, Func<object, IInteraction<TInput, TOutput>> getInteraction, Func<TInput, string> encodeInput, Func<JsonElement, TOutput> decodeOutput, TimeSpan? timeout = null)

Creates the descriptor for one ReactiveUI interaction of a ViewModel.

Parameters

name

The interaction's member name.

contract

The interaction contract that a browser handler must implement.

getInteraction

Reads the interaction from the model.

encodeInput

Encodes interaction input for the browser.

decodeOutput

Decodes the browser's answer.

timeout

How long the browser may take to answer: by default two minutes, at most 24 hours, or Timeout.InfiniteTimeSpan for no deadline. The Bridge generator passes the property's RunicInteractionTimeoutAttribute. When it passes, Interaction.Handle throws RunicInteractionTimeoutException.

Exceptions

ArgumentOutOfRangeException

timeout is not positive or exceeds 24 hours, and is not Timeout.InfiniteTimeSpan.