Skip to content

,System.Windows.Input.ICommand)} ,ReactiveMarbles.Command.RxCommand{--0,--1})} ,--1,System.Linq.Expressions.Expression{System.Func{--1,System.Windows.Input.ICommand}})} ,--2,System.Linq.Expressions.Expression{System.Func{--2,ReactiveMarbles.Command.RxCommand{--0,--1}}})} )}

RxCommandExtensions.InvokeCommand(IObservable, ICommand?) method

Defined in

Type: RxCommandExtensions Namespace: ReactiveMarbles.Command Assembly: ReactiveMarbles.Command.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IDisposable InvokeCommand<T>(this IObservable<T> item, ICommand? command)
  • 2. public static IDisposable InvokeCommand<T, TResult>(this IObservable<T> item, RxCommand<T, TResult>? command)
  • 3. public static IDisposable InvokeCommand<T, TTarget>(this IObservable<T> item, TTarget? target, Expression<Func<TTarget, ICommand?>> commandProperty) where TTarget : class, INotifyPropertyChanged
  • 4. public static IDisposable InvokeCommand<T, TResult, TTarget>(this IObservable<T> item, TTarget? target, Expression<Func<TTarget, RxCommand<T, TResult>?>> commandProperty) where TTarget : class, INotifyPropertyChanged
  • 5. public static IDisposable InvokeCommand<TParam, TResult>(this IObservable<TParam> source) where TParam : IRxCommand<TParam, TResult>

1. Overload

public static IDisposable InvokeCommand<T>(this IObservable<T> item, ICommand? command)

View source

Summary: A utility method that will pipe an Observable to an ICommand (i.e. it will first call its CanExecute with the provided value, then if the command can be executed, Execute() will be called).

Type parameters

NameDescription
TThe type.

Parameters

NameTypeDescription
itemIObservableThe source observable to pipe into the command.
commandICommand?The command to be executed.

Returns: IDisposable -- An object that when disposes, disconnects the Observable from the command.

2. Overload

public static IDisposable InvokeCommand<T, TResult>(this IObservable<T> item, RxCommand<T, TResult>? command)

View source

Summary: A utility method that will pipe an Observable to an ICommand (i.e. it will first call its CanExecute with the provided value, then if the command can be executed, Execute() will be called).

Type parameters

NameDescription
TThe type.
TResultThe result type.

Parameters

NameTypeDescription
itemIObservableThe source observable to pipe into the command.
command[RxCommand?](#The command to be executed.

Returns: IDisposable -- An object that when disposes, disconnects the Observable from the command.

3. Overload

public static IDisposable InvokeCommand<T, TTarget>(this IObservable<T> item, TTarget? target, Expression<Func<TTarget, ICommand?>> commandProperty) where TTarget : class, INotifyPropertyChanged

View source

Summary: A utility method that will pipe an Observable to an ICommand (i.e. it will first call its CanExecute with the provided value, then if the command can be executed, Execute() will be called).

Type parameters

NameDescription
TThe type.
TTargetThe target type.

Parameters

NameTypeDescription
itemIObservableThe source observable to pipe into the command.
targetTTarget?The root object which has the Command.
commandPropertyExpression>The expression to reference the Command.

Returns: IDisposable -- An object that when disposes, disconnects the Observable from the command.

4. Overload

public static IDisposable InvokeCommand<T, TResult, TTarget>(this IObservable<T> item, TTarget? target, Expression<Func<TTarget, RxCommand<T, TResult>?>> commandProperty) where TTarget : class, INotifyPropertyChanged

View source

Summary: A utility method that will pipe an Observable to an ICommand (i.e. it will first call its CanExecute with the provided value, then if the command can be executed, Execute() will be called).

Type parameters

NameDescription
TThe type.
TResultThe result type.
TTargetThe target type.

Parameters

NameTypeDescription
itemIObservableThe source observable to pipe into the command.
targetTTarget?The root object which has the Command.
commandPropertyExpression?>>The expression to reference the Command.

Returns: IDisposable -- An object that when disposes, disconnects the Observable from the command.

5. Overload

public static IDisposable InvokeCommand<TParam, TResult>(this IObservable<TParam> source) where TParam : IRxCommand<TParam, TResult>

View source

Summary: A utility method that will pipe an IRxCommand from an Observable (i.e. it will first call its CanExecute with the provided value, then if the command can be executed, Execute() will be called).

Type parameters

NameDescription
TParamThe type.
TResultThe result type.

Parameters

NameTypeDescription
sourceIObservableThe source observable to pipe into the command.

Returns: IDisposable -- An object that when disposes, disconnects the Observable from the command.