)} ,System.Reactive.Concurrency.IScheduler)} ,System.Reactive.Concurrency.IScheduler,System.Reactive.Concurrency.IScheduler)} )} ,System.IObservable{System.Boolean})} ,System.IObservable{System.Boolean},System.Reactive.Concurrency.IScheduler)} ,System.Reactive.Concurrency.IScheduler,System.Reactive.Concurrency.IScheduler)} ,System.IObservable{System.Boolean},System.Reactive.Concurrency.IScheduler,System.Reactive.Concurrency.IScheduler)} )} ,System.IObservable{System.Boolean})} ,System.IObservable{System.Boolean},System.Reactive.Concurrency.IScheduler)} ,System.Reactive.Concurrency.IScheduler,System.Reactive.Concurrency.IScheduler)} ,System.IObservable{System.Boolean},System.Reactive.Concurrency.IScheduler,System.Reactive.Concurrency.IScheduler)} )} ,System.IObservable{System.Boolean})} ,System.IObservable{System.Boolean},System.Reactive.Concurrency.IScheduler)} ,System.Reactive.Concurrency.IScheduler,System.Reactive.Concurrency.IScheduler)} ,System.IObservable{System.Boolean},System.Reactive.Concurrency.IScheduler,System.Reactive.Concurrency.IScheduler)}
ReactiveCommand.CreateRunInBackground(Action) method¶
Defined in
Type: ReactiveCommand
Namespace: ReactiveUI.Reactive
Assembly: ReactiveUI.Reactive.dll
Applies to
net10.0, net10.0-ios26.0, net10.0-android36.0, net10.0-maccatalyst26.0, net10.0-macos26.0, net10.0-tvos26.0, net9.0, net8.0, net462, net481
Overloads¶
-
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute) -
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute, IObservable<bool>? canExecute) -
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler) -
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute, IScheduler? backgroundScheduler, IScheduler? outputScheduler) -
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler, IScheduler? outputScheduler) -
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute) -
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute, IObservable<bool>? canExecute) -
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler) -
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute, IScheduler? backgroundScheduler, IScheduler? outputScheduler) -
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler, IScheduler? outputScheduler) -
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute) -
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute, IObservable<bool>? canExecute) -
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler) -
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute, IScheduler? backgroundScheduler, IScheduler? outputScheduler) -
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler, IScheduler? outputScheduler) -
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute) -
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute, IObservable<bool>? canExecute) -
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler) -
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute, IScheduler? backgroundScheduler, IScheduler? outputScheduler) -
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
1. Overload¶
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute)
Summary: Creates a parameterless reactive command with asynchronous background execution logic.
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
2. Overload¶
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute, IObservable<bool>? canExecute)
Summary: Creates a parameterless reactive command with asynchronous background execution logic.
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
3. Overload¶
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler)
Summary: Creates a parameterless reactive command with asynchronous background execution logic.
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
4. Overload¶
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
Summary: Creates a parameterless reactive command with asynchronous background execution logic.
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
outputScheduler | [IScheduler?](# | An optional scheduler that is used to surface events. Defaults to RxSchedulers.MainThreadScheduler. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
5. Overload¶
public static ReactiveCommand<Unit, Unit> CreateRunInBackground(Action execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
Summary: Creates a parameterless ReactiveCommand with asynchronous execution logic.
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
outputScheduler | [IScheduler?](# | An optional scheduler that is used to surface events. Defaults to RxSchedulers.MainThreadScheduler. |
Returns: ReactiveCommandReactiveCommand instance.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
6. Overload¶
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute)
Summary: Creates a parameterless reactive command with asynchronous background execution logic that returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
7. Overload¶
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute, IObservable<bool>? canExecute)
Summary: Creates a parameterless reactive command with asynchronous background execution logic that returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
8. Overload¶
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler)
Summary: Creates a parameterless reactive command with asynchronous background execution logic that returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
9. Overload¶
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
Summary: Creates a parameterless reactive command with asynchronous background execution logic that returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
outputScheduler | [IScheduler?](# | An optional scheduler that is used to surface events. Defaults to RxSchedulers.MainThreadScheduler. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
10. Overload¶
public static ReactiveCommand<Unit, TResult> CreateRunInBackground<TResult>(Func<TResult> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
Summary: Creates a parameterless ReactiveCommand with asynchronous execution logic that returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
outputScheduler | [IScheduler?](# | An optional scheduler that is used to surface events. Defaults to RxSchedulers.MainThreadScheduler. |
Returns: ReactiveCommandReactiveCommand instance.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
11. Overload¶
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute)
Summary: Creates a reactive command with asynchronous background execution logic that takes a parameter of type TParam.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
12. Overload¶
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute, IObservable<bool>? canExecute)
Summary: Creates a reactive command with asynchronous background execution logic that takes a parameter of type TParam.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
13. Overload¶
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler)
Summary: Creates a reactive command with asynchronous background execution logic that takes a parameter of type TParam.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
14. Overload¶
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
Summary: Creates a reactive command with asynchronous background execution logic that takes a parameter of type TParam.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
outputScheduler | [IScheduler?](# | An optional scheduler that is used to surface events. Defaults to RxSchedulers.MainThreadScheduler. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
15. Overload¶
public static ReactiveCommand<TParam, Unit> CreateRunInBackground<TParam>(Action<TParam> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
Summary: Creates a ReactiveCommand with asynchronous execution logic that takes a parameter of type TParam.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Action | The action to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
outputScheduler | [IScheduler?](# | An optional scheduler that is used to surface events. Defaults to RxSchedulers.MainThreadScheduler. |
Returns: ReactiveCommandReactiveCommand instance.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
16. Overload¶
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute)
Summary: Creates a reactive command with asynchronous background execution logic that takes a parameter of type TParam and returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
17. Overload¶
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute, IObservable<bool>? canExecute)
Summary: Creates a reactive command with asynchronous background execution logic that takes a parameter of type TParam and returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
18. Overload¶
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler)
Summary: Creates a reactive command with asynchronous background execution logic that takes a parameter of type TParam and returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
19. Overload¶
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
Summary: Creates a reactive command with asynchronous background execution logic that takes a parameter of type TParam and returns a value of type TResult.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
outputScheduler | [IScheduler?](# | An optional scheduler that is used to surface events. Defaults to RxSchedulers.MainThreadScheduler. |
Returns: ReactiveCommand
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |
20. Overload¶
public static ReactiveCommand<TParam, TResult> CreateRunInBackground<TParam, TResult>(Func<TParam, TResult> execute, IObservable<bool>? canExecute, IScheduler? backgroundScheduler, IScheduler? outputScheduler)
Summary: Creates an asynchronous ReactiveCommand from TParam to TResult.
Type parameters
| Name | Description |
|---|---|
TParam | The type of the parameter passed through to command execution. |
TResult | The type of value returned by command executions. |
Parameters
| Name | Type | Description |
|---|---|---|
execute | Func | The function to execute whenever the command is executed. |
canExecute | IObservable | An optional observable that dictates the availability of the command for execution. |
backgroundScheduler | [IScheduler?](# | The background scheduler. |
outputScheduler | [IScheduler?](# | An optional scheduler that is used to surface events. Defaults to RxSchedulers.MainThreadScheduler. |
Returns: ReactiveCommandReactiveCommand instance.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | execute. |