},System.Linq.Expressions.Expression{System.Func{--0,--3}},System.String)} },System.Linq.Expressions.Expression{System.Func{--0,--3}},System.IObservable{--4},System.String)} },System.Linq.Expressions.Expression{System.Func{--0,--3}},System.Linq.Expressions.Expression{System.Func{--1,--4}},System.String)}
ReactiveUIBindingExtensions.BindCommandUnsafe(TView, TViewModel?, Expression>, Expression>, string?) method¶
Defined in
Type: ReactiveUIBindingExtensions
Namespace: ReactiveUI.Binding.Reactive
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
Overloads¶
- 1.
public static IDisposable BindCommandUnsafe<TView, TViewModel, TProp, TControl>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TProp?>> propertyName, Expression<Func<TView, TControl>> controlName, string? toEvent) where TView : class, IViewFor where TViewModel : class where TProp : ICommand where TControl : class - 2.
public static IDisposable BindCommandUnsafe<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TProp?>> propertyName, Expression<Func<TView, TControl>> controlName, IObservable<TParam?> withParameter, string? toEvent) where TView : class, IViewFor where TViewModel : class where TProp : ICommand where TControl : class - 3.
public static IDisposable BindCommandUnsafe<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TProp?>> propertyName, Expression<Func<TView, TControl>> controlName, Expression<Func<TViewModel, TParam?>> withParameter, string? toEvent) where TView : class, IViewFor where TViewModel : class where TProp : ICommand where TControl : class
1. Overload¶
Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]
public static IDisposable BindCommandUnsafe<TView, TViewModel, TProp, TControl>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TProp?>> propertyName, Expression<Func<TView, TControl>> controlName, string? toEvent) where TView : class, IViewFor where TViewModel : class where TProp : ICommand where TControl : class
Summary: Binds a command from a view model to a control on a view.
Type parameters
| Name | Description |
|---|---|
TView | The type of the view. |
TViewModel | The type of the view model. |
TProp | The type of the command property. |
TControl | The type of the control. |
Parameters
| Name | Type | Description |
|---|---|---|
view | TView | The view to bind to. |
viewModel | TViewModel? | The view model containing the command. |
propertyName | Expression | An expression that selects the command property on the view model. |
controlName | Expression | An expression that selects the control on the view. |
toEvent | string? | The event name to bind to. If null, a default event is selected. |
Returns: IDisposable -- A disposable that, when disposed, disconnects the binding.
Remarks
Resolves the property chain by reflection, for an expression the generator could not read.
2. Overload¶
Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]
public static IDisposable BindCommandUnsafe<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TProp?>> propertyName, Expression<Func<TView, TControl>> controlName, IObservable<TParam?> withParameter, string? toEvent) where TView : class, IViewFor where TViewModel : class where TProp : ICommand where TControl : class
Summary: Binds a command from a view model to a control on a view with an observable parameter.
Type parameters
| Name | Description |
|---|---|
TView | The type of the view. |
TViewModel | The type of the view model. |
TProp | The type of the command property. |
TControl | The type of the control. |
TParam | The type of the command parameter. |
Parameters
| Name | Type | Description |
|---|---|---|
view | TView | The view to bind to. |
viewModel | TViewModel? | The view model containing the command. |
propertyName | Expression | An expression that selects the command property on the view model. |
controlName | Expression | An expression that selects the control on the view. |
withParameter | IObservable | An observable that provides the command parameter. |
toEvent | string? | The event name to bind to. If null, a default event is selected. |
Returns: IDisposable -- A disposable that, when disposed, disconnects the binding.
Remarks
Resolves the property chain by reflection, for an expression the generator could not read.
3. Overload¶
Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]
public static IDisposable BindCommandUnsafe<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TProp?>> propertyName, Expression<Func<TView, TControl>> controlName, Expression<Func<TViewModel, TParam?>> withParameter, string? toEvent) where TView : class, IViewFor where TViewModel : class where TProp : ICommand where TControl : class
Summary: Binds a command from a view model to a control on a view with a parameter expression.
Type parameters
| Name | Description |
|---|---|
TView | The type of the view. |
TViewModel | The type of the view model. |
TProp | The type of the command property. |
TControl | The type of the control. |
TParam | The type of the command parameter. |
Parameters
| Name | Type | Description |
|---|---|---|
view | TView | The view to bind to. |
viewModel | TViewModel? | The view model containing the command. |
propertyName | Expression | An expression that selects the command property on the view model. |
controlName | Expression | An expression that selects the control on the view. |
withParameter | Expression | An expression that selects the command parameter property on the view model. |
toEvent | string? | The event name to bind to. If null, a default event is selected. |
Returns: IDisposable -- A disposable that, when disposed, disconnects the binding.
Remarks
Resolves the property chain by reflection, for an expression the generator could not read.