Class ViewForMixins
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
A set of extension methods to help wire up View and ViewModel activation.
- Inheritance
-
View
For Mixins
Methods
WhenActivated(IActivatableView, Action<Action<IDisposable>>)
WhenActivated allows you to register a Func to be called when a View is Activated.
public static IDisposable WhenActivated(this IActivatableView item, Action<Action<IDisposable>> block)
Parameters
item
IActivatableView Object that supports activation.
block
Action<Action<IDisposable>>The method to be called when the corresponding View is activated. The Action parameter (usually called 'd') allows you to register Disposables to be cleaned up when the View is deactivated (i.e. "d(someObservable.Subscribe());").
Returns
- IDisposable
A Disposable that deactivates this registration.
WhenActivated(IActivatableView, Action<Action<IDisposable>>, IViewFor)
WhenActivated allows you to register a Func to be called when a View is Activated.
public static IDisposable WhenActivated(this IActivatableView item, Action<Action<IDisposable>> block, IViewFor view)
Parameters
item
IActivatableView Object that supports activation.
block
Action<Action<IDisposable>>The method to be called when the corresponding View is activated. The Action parameter (usually called 'd') allows you to register Disposables to be cleaned up when the View is deactivated (i.e. "d(someObservable.Subscribe());").
view
IViewFor The IActivatableView will ordinarily also host the View Model, but in the event it is not, a class implementing IView
For can be supplied here.
Returns
- IDisposable
A Disposable that deactivates this registration.
WhenActivated(IActivatableView, Action<CompositeDisposable>, IViewFor?)
WhenActivated allows you to register a Func to be called when a View is Activated.
public static IDisposable WhenActivated(this IActivatableView item, Action<CompositeDisposable> block, IViewFor? view = null)
Parameters
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 IView
For can be supplied here.
Returns
- IDisposable
A Disposable that deactivates this registration.
WhenActivated(IActivatableView, Func<IEnumerable<IDisposable>>)
WhenActivated allows you to register a Func to be called when a View is Activated.
public static IDisposable WhenActivated(this IActivatableView item, Func<IEnumerable<IDisposable>> block)
Parameters
item
IActivatableView Object that supports activation.
block
Func<IEnumerable<IDisposable>>The method to be called when the corresponding View is activated. It returns a list of Disposables that will be cleaned up when the View is deactivated.
Returns
- IDisposable
A Disposable that deactivates this registration.
WhenActivated(IActivatableView, Func<IEnumerable<IDisposable>>, IViewFor?)
WhenActivated allows you to register a Func to be called when a View is Activated.
public static IDisposable WhenActivated(this IActivatableView item, Func<IEnumerable<IDisposable>> block, IViewFor? view)
Parameters
item
IActivatableView Object that supports activation.
block
Func<IEnumerable<IDisposable>>The method to be called when the corresponding View is activated. It returns a list of Disposables that will be cleaned up when the View is deactivated.
view
IViewFor The IActivatableView will ordinarily also host the View Model, but in the event it is not, a class implementing IView
For can be supplied here.
Returns
- IDisposable
A Disposable that deactivates this registration.
WhenActivated(IActivatableViewModel, Action<Action<IDisposable>>)
WhenActivated allows you to register a Func to be called when a ViewModel's View is Activated.
public static void WhenActivated(this IActivatableViewModel item, Action<Action<IDisposable>> block)
Parameters
item
IActivatableView Model Object that supports activation.
block
Action<Action<IDisposable>>The method to be called when the corresponding View is activated. The Action parameter (usually called 'd') allows you to register Disposables to be cleaned up when the View is deactivated (i.e. "d(someObservable.Subscribe());").
WhenActivated(IActivatableViewModel, Action<CompositeDisposable>)
WhenActivated allows you to register a Func to be called when a ViewModel's View is Activated.
public static void WhenActivated(this IActivatableViewModel item, Action<CompositeDisposable> block)
Parameters
item
IActivatableView Model 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 the disposables to be cleaned up during deactivation.
WhenActivated(IActivatableViewModel, Func<IEnumerable<IDisposable>>)
WhenActivated allows you to register a Func to be called when a ViewModel's View is Activated.
public static void WhenActivated(this IActivatableViewModel item, Func<IEnumerable<IDisposable>> block)
Parameters
item
IActivatableView Model Object that supports activation.
block
Func<IEnumerable<IDisposable>>The method to be called when the corresponding View is activated. It returns a list of Disposables that will be cleaned up when the View is deactivated.