Table of Contents

Class RxApp

Namespace
ReactiveUI
Assembly
ReactiveUI.dll

The main registration point for common class instances throughout a ReactiveUI application.

public static class RxApp : Object
Inheritance
RxApp

Remarks

N.B. Why we have this evil global class In a WPF or UWP application, most commands must have the Dispatcher scheduler set, because notifications will end up being run on another thread; this happens most often in a CanExecute observable.Unfortunately, in a Unit Test framework, while the MS Test Unit runner will set the Dispatcher (so we can't even use the lack of its presence to determine whether we're in a test runner or not), none of the items queued to it will ever be executed during the unit test. Initially, I tried to plumb the ability to set the scheduler throughout the classes, but when you start building applications on top of that, having to have *every single * class have a default Scheduler property is really irritating, with either default making life difficult. This class also initializes a whole bunch of other stuff, including the IoC container, logging and error handling.

Fields

BigCacheLimit

The size of a large cache of items. Often used for the MemoizingMRUCache class.

public const int BigCacheLimit = 64

Field Value

int

SmallCacheLimit

The size of a small cache of items. Often used for the MemoizingMRUCache class.

public const int SmallCacheLimit = 32

Field Value

int

Properties

DefaultExceptionHandler

Gets or sets the Observer which signaled whenever an object that has a ThrownExceptions property doesn't Subscribe to that Observable. Use Observer.Create to set up what will happen - the default is to crash the application with an error message.

public static IObserver<Exception> DefaultExceptionHandler { get; set; }

Property Value

IObserver<Exception>

MainThreadScheduler

Gets or sets a scheduler used to schedule work items that should be run "on the UI thread". In normal mode, this will be DispatcherScheduler, and in Unit Test mode this will be Immediate, to simplify writing common unit tests.

public static IScheduler MainThreadScheduler { get; set; }

Property Value

IScheduler

SuppressViewCommandBindingMessage

Gets or sets a value indicating whether log messages should be suppressed for command bindings in the view.

public static bool SuppressViewCommandBindingMessage { get; set; }

Property Value

bool

SuspensionHost

Gets or sets the current SuspensionHost, a class which provides events for process lifetime events, especially on mobile devices.

public static ISuspensionHost SuspensionHost { get; set; }

Property Value

ISuspensionHost

TaskpoolScheduler

Gets or sets the a the scheduler used to schedule work items to run in a background thread. In both modes, this will run on the TPL Task Pool.

public static IScheduler TaskpoolScheduler { get; set; }

Property Value

IScheduler