コード例 #1
0
 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);
コード例 #2
0
 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));
 }
コード例 #3
0
 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));
 }
コード例 #4
0
        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));
        }
コード例 #5
0
 static CommandBinder()
 {
     binderImplementation = new CommandBinderImplementation();
 }
コード例 #6
0
 internal static void Initialize(ICommandBinderImplementation commandBinderImplementation)
 {
     _binderImplementation = commandBinderImplementation ?? throw new ArgumentNullException(nameof(commandBinderImplementation));
 }
コード例 #7
0
 static CommandBinder()
 {
     binderImplementation = RxApp.DependencyResolver.GetService <ICommandBinderImplementation>() ??
                            new CommandBinderImplementation();
 }