Skip to content

}},System.Func{ReactiveUI.Binding.IInteractionContext{--2,--3},System.Threading.Tasks.Task},System.String,System.String,System.Int32)} }},System.Func{ReactiveUI.Binding.IInteractionContext{--2,--3},System.IObservable{--4}},System.String,System.String,System.Int32)}

ReactiveUIBindingExtensions.BindInteraction(TView, TViewModel?, Expression>>, Func, Task>, string, string, int) method

Defined in

Type: ReactiveUIBindingExtensions Namespace: ReactiveUI.Binding Assembly: ReactiveUI.Binding.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Overloads

  • 1. public static IDisposable BindInteraction<TViewModel, TView, TInput, TOutput>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, IInteraction<TInput, TOutput>>> propertyName, Func<IInteractionContext<TInput, TOutput>, Task> handler, string propertyNameExpression = "", string callerFilePath = "", int callerLineNumber = 0) where TViewModel : class where TView : class, IViewFor
  • 2. public static IDisposable BindInteraction<TViewModel, TView, TInput, TOutput, TDontCare>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, IInteraction<TInput, TOutput>>> propertyName, Func<IInteractionContext<TInput, TOutput>, IObservable<TDontCare>> handler, string propertyNameExpression = "", string callerFilePath = "", int callerLineNumber = 0) where TViewModel : class where TView : class, IViewFor

1. Overload

public static IDisposable BindInteraction<TViewModel, TView, TInput, TOutput>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, IInteraction<TInput, TOutput>>> propertyName, Func<IInteractionContext<TInput, TOutput>, Task> handler, string propertyNameExpression = "", string callerFilePath = "", int callerLineNumber = 0) where TViewModel : class where TView : class, IViewFor

View source

Summary: Binds a task-based handler to an interaction exposed by the view model.

Type parameters

NameDescription
TViewModelThe type of the view model.
TViewThe type of the view.
TInputThe type of the interaction's input.
TOutputThe type of the interaction's output.

Parameters

NameTypeDescription
viewTViewThe view that provides the handler.
viewModelTViewModel?The view model that exposes the interaction.
propertyNameExpression>>An expression that selects the interaction property on the view model.
handlerFunc, Task>A task-based handler for the interaction.
propertyNameExpression = ""stringThe caller argument expression for propertyName. Auto-populated by the compiler.
callerFilePath = ""stringThe source file path of the caller. Auto-populated by the compiler.
callerLineNumber = 0intThe source line number of the caller. Auto-populated by the compiler.

Returns: IDisposable -- A disposable that, when disposed, disconnects the binding.

2. Overload

public static IDisposable BindInteraction<TViewModel, TView, TInput, TOutput, TDontCare>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, IInteraction<TInput, TOutput>>> propertyName, Func<IInteractionContext<TInput, TOutput>, IObservable<TDontCare>> handler, string propertyNameExpression = "", string callerFilePath = "", int callerLineNumber = 0) where TViewModel : class where TView : class, IViewFor

View source

Summary: Binds an observable-based handler to an interaction exposed by the view model.

Type parameters

NameDescription
TViewModelThe type of the view model.
TViewThe type of the view.
TInputThe type of the interaction's input.
TOutputThe type of the interaction's output.
TDontCareThe signal type of the observable handler.

Parameters

NameTypeDescription
viewTViewThe view that provides the handler.
viewModelTViewModel?The view model that exposes the interaction.
propertyNameExpression>>An expression that selects the interaction property on the view model.
handlerFunc, IObservable>An observable-based handler for the interaction.
propertyNameExpression = ""stringThe caller argument expression for propertyName. Auto-populated by the compiler.
callerFilePath = ""stringThe source file path of the caller. Auto-populated by the compiler.
callerLineNumber = 0intThe source line number of the caller. Auto-populated by the compiler.

Returns: IDisposable -- A disposable that, when disposed, disconnects the binding.