Class OneWayBindingWithConversion<TViewModel, TViewProp, TOut>
Represents a one way View and ViewModel binding.
public class OneWayBindingWithConversion<TViewModel, TViewProp, TOut> : IOneWayBind<TViewModel, TViewProp> where TViewModel : class
Type Parameters
TViewModel
The type for the ViewModel.
TViewProp
The type for the View.
TOut
The type for the control binding.
- Inheritance
-
OneWayBindingWithConversion<TViewModel, TViewProp, TOut>
- Implements
-
IOneWayBind<TViewModel, TViewProp>
- Inherited Members
Constructors
OneWayBindingWithConversion(Expression<Func<TViewModel, TViewProp?>>, Func<TViewProp, TOut>)
Initializes a new instance of the OneWayBindingWithConversion<TViewModel, TViewProp, TOut> class.
public OneWayBindingWithConversion(Expression<Func<TViewModel, TViewProp?>> viewModelBinding, Func<TViewProp, TOut> selector)
Parameters
viewModelBinding
Expression<Func<TViewModel, TViewProp>>Expression for the View Model binding.
selector
Func<TViewProp, TOut>Conversion selector function.
Properties
Selector
Gets the conversion selector function.
public Func<TViewProp, TOut> Selector { get; }
Property Value
- Func<TViewProp, TOut>
ViewModelBinding
Gets the binding to apply between the ViewModel and the View.
public Expression<Func<TViewModel, TViewProp?>> ViewModelBinding { get; }
Property Value
- Expression<Func<TViewModel, TViewProp>>
Methods
ApplyBinding<TView>(Action<IDisposable>, TView, TViewModel, Expression<Func<TView, TViewProp>>)
Applies a View to View Model Binding.
public void ApplyBinding<TView>(Action<IDisposable> d, TView view, TViewModel viewModel, Expression<Func<TView, TViewProp>> viewBinding) where TView : class, IViewFor<TViewModel>
Parameters
d
Action<IDisposable>The 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.
ApplyBinding<TView>(CompositeDisposable, TView, TViewModel, Expression<Func<TView, TViewProp>>)
Applies a View to View Model Binding.
public void ApplyBinding<TView>(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.