public void BindVM <TDescriptor>(Expression <Func <TScreen, IViewModelExpression <TDescriptor> > > viewModelSelector, Action <IVMBinder <TDescriptor> > bindingConfigurator) where TDescriptor : VMDescriptor { string pathPrefix = ExpressionService.GetPropertyPathString(viewModelSelector); VMPropertyBinder <TDescriptor> binder = new VMPropertyBinder <TDescriptor>(pathPrefix); bindingConfigurator(binder); binder.Execute(); }
public static void BindVM <TDescriptor>( Action <IVMBinder <TDescriptor> > bindingConfigurator ) where TDescriptor : IVMDescriptor { // See http://sweux.com/blogs/laranjeira/index.php/wpf/design-mode-wpf/how-to-get-design-mode-property-in-wpf/ if (DesignerProperties.GetIsInDesignMode(new DependencyObject())) { return; } VMPropertyBinder <TDescriptor> binder = new VMPropertyBinder <TDescriptor>(); bindingConfigurator(binder); binder.Execute(); }
public static void BindVM <TDescriptor>( IBindableView <IViewModelExpression <TDescriptor> > view, Action <IVMBinder <TDescriptor> > bindingConfigurator ) where TDescriptor : IVMDescriptor { if (DesignerProperties.GetIsInDesignMode((DependencyObject)view)) { return; } VMPropertyBinder <TDescriptor> binder = new VMPropertyBinder <TDescriptor>(); bindingConfigurator(binder); binder.Execute(); }