FlexibleCommandBinder.

BindCommandToObject<TEventArgs>(ICommand, object, IObservable<object>, string) Method

Summary

Bind an ICommand to a UI object to a specific event. This event may be a standard .NET event, or it could be an event derived in another manner (i.e. in MonoTouch).
Namespace
ReactiveUI
Containing Type
FlexibleCommandBinder

Syntax

public IDisposable BindCommandToObject<TEventArgs>(ICommand command, object target, IObservable<object> commandParameter, string eventName) 
    where TEventArgs : EventArgs

Type Parameters

Name Description
TEventArgs The event argument type.

Parameters

Name Type Description
command ICommand The command to bind.
target object The target object, usually a UI control of some kind.
commandParameter IObservable<object> An IObservable source whose latest value will be passed as the command parameter to the command. Hosts will always pass a valid IObservable, but this may be Observable.Empty.
eventName string The event to bind to.

Return Value

Type Description
IDisposable An IDisposable which will disconnect the binding when disposed.