Class CommandBinding<TViewModel>
Represents a command binding between a control and a viewmodel.
public sealed class CommandBinding<TViewModel> : ICommandBinding<TViewModel> where TViewModel : class
Type Parameters
TViewModel
The type for the viewmodel.
- Inheritance
-
CommandBinding<TViewModel>
- Implements
-
ICommandBinding<TViewModel>
- Inherited Members
Constructors
CommandBinding(Expression<Func<TViewModel, ICommand?>>, string?)
Initializes a new instance of the CommandBinding<TViewModel> class.
public CommandBinding(Expression<Func<TViewModel, ICommand?>> viewModelBinding, string? toEvent = null)
Parameters
viewModelBinding
Expression<Func<TViewModel, ICommand>>Expression for the View Model binding.
toEvent
stringIf specified, bind to the specific event instead of the default.
Methods
ApplyBinding<TView, TViewProp>(Action<IDisposable>, TView, TViewModel, Expression<Func<TView, TViewProp>>)
Applies a View to View Model Binding.
public void ApplyBinding<TView, TViewProp>(Action<IDisposable> disposeAction, TView view, TViewModel viewModel, Expression<Func<TView, TViewProp>> viewBinding) where TView : class, IViewFor<TViewModel>
Parameters
disposeAction
Action<IDisposable>view
TViewThe instance of the View to bind.
viewModel
TViewModelThe instance of the ViewModel to Bind.
viewBinding
Expression<Func<TView, TViewProp>>Expression of the View Property to Bind to.
Type Parameters
TView
The type for the view.
TViewProp
The type for the View Property.
ApplyBinding<TView, TViewProp>(CompositeDisposable, TView, TViewModel, Expression<Func<TView, TViewProp>>)
Applies a View to View Model Binding.
public void ApplyBinding<TView, TViewProp>(CompositeDisposable compositeDisposable, TView view, TViewModel viewModel, Expression<Func<TView, TViewProp>> viewBinding) where TView : class, IViewFor<TViewModel>
Parameters
compositeDisposable
CompositeDisposableThe disposable action registration. Used to clean up when bindings fall out of scope.
view
TViewThe instance of the View to bind.
viewModel
TViewModelThe instance of the ViewModel to Bind.
viewBinding
Expression<Func<TView, TViewProp>>Expression of the View Property to Bind to.
Type Parameters
TView
The type for the view.
TViewProp
The type for the View Property.