public static IReactiveBinding <TView, TProp> BindCommand <TView, TViewModel, TProp, TControl>( this ICommandBinderImplementation @this, TViewModel?viewModel, TView view, Expression <Func <TViewModel, TProp?> > propertyName, Expression <Func <TView, TControl> > controlName, string?toEvent = null) where TView : class, IViewFor <TViewModel> where TViewModel : class where TProp : ICommand => @this.BindCommand(viewModel, view, propertyName, controlName, Observable <object> .Empty, toEvent);
public static IDisposable BindCommand <TView, TViewModel, TProp, TControl>( this ICommandBinderImplementation This, TViewModel viewModel, TView view, Expression <Func <TViewModel, TProp> > propertyName, Expression <Func <TView, TControl> > controlName, string toEvent = null) where TViewModel : class where TView : class, IViewFor <TViewModel> where TProp : ICommand { return(This.BindCommand(viewModel, view, propertyName, controlName, Observable.Empty <object>(), toEvent)); }
public static IDisposable BindCommand <TView, TViewModel, TProp, TControl, TParam>( this ICommandBinderImplementation This, TViewModel viewModel, TView view, Expression <Func <TViewModel, TProp> > propertyName, Expression <Func <TView, TControl> > controlName, Expression <Func <TViewModel, TParam> > withParameter, string toEvent = null) where TViewModel : class where TView : class, IViewFor <TViewModel> where TProp : ICommand { return(This.BindCommand(viewModel, view, propertyName, controlName, view.ViewModel.WhenAny(withParameter, x => x.Value), toEvent)); }
public static IReactiveBinding <TView, TViewModel, TProp> BindCommand <TView, TViewModel, TProp, TControl, TParam>( this ICommandBinderImplementation This, TViewModel viewModel, TView view, Expression <Func <TViewModel, TProp> > propertyName, Expression <Func <TView, TControl> > controlName, Expression <Func <TViewModel, TParam> > withParameter, string toEvent = null) where TViewModel : class where TView : class, IViewFor <TViewModel> where TProp : ICommand { var paramExpression = Reflection.Rewrite(withParameter.Body); var param = Reflection.ViewModelWhenAnyValue(viewModel, view, paramExpression); return(This.BindCommand(viewModel, view, propertyName, controlName, param, toEvent)); }
static CommandBinder() { binderImplementation = new CommandBinderImplementation(); }
internal static void Initialize(ICommandBinderImplementation commandBinderImplementation) { _binderImplementation = commandBinderImplementation ?? throw new ArgumentNullException(nameof(commandBinderImplementation)); }
static CommandBinder() { binderImplementation = RxApp.DependencyResolver.GetService <ICommandBinderImplementation>() ?? new CommandBinderImplementation(); }