ViewForMixins.

WhenActivated(IActivatableView, Action<CompositeDisposable>, IViewFor) Method

Summary

WhenActivated allows you to register a Func to be called when a View is Activated.
Namespace
ReactiveUI
Containing Type
ViewForMixins

Syntax

public static IDisposable WhenActivated(this IActivatableView item, Action<CompositeDisposable> block, IViewFor view = null)

Parameters

Name Type Description
item IActivatableView Object that supports activation.
block Action<CompositeDisposable> The method to be called when the corresponding View is activated. The Action parameter (usually called 'disposables') allows you to collate all disposables that should be cleaned up during deactivation.
view IViewFor The IActivatableView will ordinarily also host the View Model, but in the event it is not, a class implementing IViewFor can be supplied here.

Return Value

Type Description
IDisposable A Disposable that deactivates this registration.