>
Defined in Type: RuntimeCommandBindingFallback
Namespace: ReactiveUI.Binding.Reactive.Fallback
Assembly: ReactiveUI.Binding.Reactive.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-ios18.0, net9.0-macos15.0, net9.0-desktop1.0, net8.0, net8.0-macos14.5, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, netstandard2.1, net481, net462, net471
Attributes: [RequiresUnreferencedCode("Runtime command binding resolves the property chain by reflection.")]
public static IDisposable BindCommand<TView, TViewModel, TProp, TControl>(TView view, TViewModel? viewModel, Expression<Func<TViewModel, TProp?>> commandProperty, Expression<Func<TView, TControl>> controlProperty, IObservable<object?> commandParameter, string? toEvent, string bindingExpression) where TView : class where TViewModel : class where TProp : ICommand where TControl : class
Summary: Keeps the command an observed property holds bound to the control another one holds.
Type parameters
| Name | Description |
|---|---|
TView | The type declaring the control property. |
TViewModel | The type declaring the command property. |
TProp | The type of the command property. |
TControl | The type of the control the command is bound to. |
Parameters
| Name | Type | Description |
|---|---|---|
view | TView | The object declaring the control property. |
viewModel | TViewModel? | The object declaring the command property. |
commandProperty | Expression | The property holding the command to bind. |
controlProperty | Expression | The property holding the control to bind it to. |
commandParameter | IObservable | The values offered as the command parameter. |
toEvent | string? | The control event that executes the command, or null for the control's default. |
bindingExpression | string | The bound expression, named when the observation faults. |
Returns: IDisposable -- A disposable that, when disposed, unbinds the command and stops observing.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | commandProperty or controlProperty is null. |