public IVMPropertyDescriptor <IVMCollection <TChildVM> > CollectionProperty <TChildVM>( IVMDescriptor itemDescriptor, IBehavior valueAccessor, IBehavior sourceAccessor = null, Action <BehaviorChainConfiguration> chainConfigurationAction = null ) where TChildVM : IViewModel { return(CustomProperty <IVMCollection <TChildVM> >( DefaultBehaviorChainTemplateKeys.CollectionProperty, BehaviorFactoryConfigurations.ForChildProperty <TOwnerVM, TChildVM, TSourceObject>(), config => { config.Enable(PropertyBehaviorKeys.ValueAccessor, valueAccessor); config.Enable( CollectionPropertyBehaviorKeys.ItemDescriptorProvider, new ItemDescriptorProviderBehavior(itemDescriptor) ); if (sourceAccessor != null) { config.Enable(PropertyBehaviorKeys.SourceAccessor, sourceAccessor); } }, chainConfigurationAction )); }
public void ReplaceConfiguration(BehaviorChainTemplateKey templateKey) { _configuration.ViewModelConfiguration = BehaviorChainConfiguration.GetConfiguration( templateKey, BehaviorFactoryConfigurations.ForViewModel <TVM>() ); }
public IVMPropertyDescriptor <TValue> PropertyWithSource <TValue>( IBehavior valueAccessor, Action <BehaviorChainConfiguration> chainConfigurationAction = null ) { return(CustomProperty <TValue>( DefaultBehaviorChainTemplateKeys.PropertyWithSource, BehaviorFactoryConfigurations.ForSimpleProperty <TOwnerVM, TValue, TSourceObject>(true), config => config.Enable(PropertyBehaviorKeys.ValueAccessor, valueAccessor), chainConfigurationAction )); }
public IVMPropertyDescriptor <ICommand> CommandProperty( IBehavior sourceObjectAccessor, IBehavior commandExecutor, Action <BehaviorChainConfiguration> chainConfigurationAction = null ) { return(CustomProperty <ICommand>( DefaultBehaviorChainTemplateKeys.CommandProperty, BehaviorFactoryConfigurations.ForSimpleProperty <TOwnerVM, ICommand, TSourceObject>(false), config => { config.Enable(PropertyBehaviorKeys.SourceAccessor, sourceObjectAccessor); config.Enable(CommandPropertyBehaviorKeys.CommandExecutor, commandExecutor); }, chainConfigurationAction )); }
public IVMPropertyDescriptor <TChildVM> ViewModelPropertyWithSource <TChildVM, TChildSource>( IBehavior valueAccessor, IBehavior sourceAccessor = null, Action <BehaviorChainConfiguration> chainConfigurationAction = null ) where TChildVM : IViewModel, IHasSourceObject <TChildSource> { return(CustomProperty <TChildVM>( DefaultBehaviorChainTemplateKeys.ViewModelPropertyWithSource, BehaviorFactoryConfigurations.ForChildProperty <TOwnerVM, TChildVM, TSourceObject, TChildSource>(), config => { config.Enable(PropertyBehaviorKeys.ValueAccessor, valueAccessor); if (sourceAccessor != null) { config.Enable(PropertyBehaviorKeys.SourceAccessor, sourceAccessor); } }, chainConfigurationAction )); }