using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using ReactiveUI; namespace Wabbajack { public static class IViewForExt { public static IReactiveBinding OneWayBindStrict( this TView view, TViewModel viewModel, Expression> vmProperty, Expression> viewProperty) where TViewModel : class where TView : class, IViewFor { return view.OneWayBind( viewModel: viewModel, vmProperty: vmProperty, viewProperty: viewProperty); } public static IReactiveBinding OneWayBindStrict( this TView view, TViewModel viewModel, Expression> vmProperty, Expression> viewProperty, Func selector) where TViewModel : class where TView : class, IViewFor { return view.OneWayBind( viewModel: viewModel, vmProperty: vmProperty, viewProperty: viewProperty, selector: selector); } public static IReactiveBinding BindStrict( this TView view, TViewModel viewModel, Expression> vmProperty, Expression> viewProperty) where TViewModel : class where TView : class, IViewFor { return view.Bind( viewModel: viewModel, vmProperty: vmProperty, viewProperty: viewProperty); } public static IReactiveBinding BindStrict( this TView view, TViewModel viewModel, Expression> vmProperty, Expression> viewProperty, Func vmToViewConverter, Func viewToVmConverter) where TViewModel : class where TView : class, IViewFor { return view.Bind( viewModel: viewModel, vmProperty: vmProperty, viewProperty: viewProperty, vmToViewConverter: vmToViewConverter, viewToVmConverter: viewToVmConverter); } } }