The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

RoutableViewModelMixin Class

Summary

Extension methods associated with the IRoutableViewModel interface.
Namespace
ReactiveUI
Base Types
  • object
graph BT Type-->Base0["object"] Type["RoutableViewModelMixin"] class Type type-node

Syntax

public static class RoutableViewModelMixin

Methods

Name Value Summary
WhenNavigatedTo(IRoutableViewModel, Func<IDisposable>) IDisposable
This method allows you to set up connections that only operate while the ViewModel has focus, and cleans up when the ViewModel loses focus.
static
WhenNavigatedToObservable(IRoutableViewModel) IObservable<Unit>

This method will return an observable that fires events every time the topmost ViewModel in the navigation stack is this ViewModel. This allows you to set up connections that only operate while the ViewModel has focus.

The observable will complete when the ViewModel is removed completely from the navigation stack. If your ViewModel can be _removed_ from the navigation stack and then reused later, you must call this method and resubscribe each time it is reused.

static
WhenNavigatingFromObservable(IRoutableViewModel) IObservable<Unit>

This method will return an observable that fires events _just before_ the ViewModel is no longer the topmost ViewModel in the navigation stack. This allows you to clean up anything before losing focus.

The observable will complete when the ViewModel is removed completely from the navigation stack. If your ViewModel can be _removed_ from the navigation stack and then reused later, you must call this method and resubscribe each time it is reused.

static

Extension Methods

Name Value Summary
InvokeViewModelAction<T>(Action<T>) object
This is a thing I lifted from Prism.