ReactiveCommandExecution class

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

public static class ReactiveCommandExecution

Executes the ReactiveUI command contracts that are intentionally broader than ICommand. Generated bridges use this helper instead of assuming that a ViewModel exposed a concrete ReactiveCommand<TParam, TResult>.

Methods

CanExecute

public static bool CanExecute<TInput, TResult>(IReactiveCommand<TInput, TResult> command, TInput input)

Returns the current availability when the command offers the normal ICommand adapter. ReactiveUI commands do, including commands exposed through their IReactiveCommand interface.

Execute

public static Task<TResult> Execute<TInput, TResult>(IReactiveCommand<TInput, TResult> command, TInput input, CancellationToken cancellationToken)

Executes a typed ReactiveUI command and requires exactly one result. ReactiveCommand normally has that cardinality; retaining the check protects a bridge contract from silently treating a custom observable implementation as last-value-wins.

ExecuteCompletion

public static Task ExecuteCompletion<TInput, TResult>(IReactiveCommand<TInput, TResult> command, TInput input, CancellationToken cancellationToken)

Waits for command completion when the generated contract has no output. No-result commands are allowed to publish zero or more internal values; requiring one would incorrectly turn a completed no-result effect into a cardinality failure.

ExecuteLast

public static Task<TResult> ExecuteLast<TInput, TResult>(IReactiveCommand<TInput, TResult> command, TInput input, CancellationToken cancellationToken)

Explicit last-result cardinality. It is separate from ReactiveCommandExecution.Execute so a generator cannot silently change a multi-value observable into a last-value contract.

ExecuteStream

public static Task<BridgeOperationResult> ExecuteStream<TInput, TResult>(IReactiveCommand<TInput, TResult> command, TInput input, BridgeOperationStream stream, Func<TResult, string> encode, CancellationToken cancellationToken)

Publishes every observable value to an admitted bounded stream. Result serialization and retention failures remain visible delivery outcomes; they do not rewrite a successful side effect as a command failure. Once the stream overflows or fails, the execution is stopped: disposing its subscription cancels the command instead of producing into a stream that can no longer accept values.

IsExecuting

public static bool IsExecuting<TInput, TResult>(IReactiveCommand<TInput, TResult> command)

Returns the latest observed ReactiveUI execution state.

Observe

public static IDisposable Observe<TInput, TResult>(IReactiveCommand<TInput, TResult> command, Action changed)

Observes state changes for the lifetime of one generated bridge. The returned lease owns the observation, while state is shared per command instance so mirrored presentations see the same value.