internal SourceItemPropertyBinding( [NotNull] ItemReference <TItem> itemReference, [NotNull] ItemValueAccessor <TItem, TValue> itemValueAccessor) : base(itemReference, itemValueAccessor.ToString) { _itemValueAccessor = itemValueAccessor; }
internal SourceItemCommandBinding( [NotNull] ItemReference <TItem> itemReference, [NotNull] ItemValueAccessor <TItem, ICommand> itemValueAccessor) : base(itemReference, itemValueAccessor.ToString) { _itemValueAccessor = itemValueAccessor; }
public ICompositeItemCommandBindingBuilder <TSourceItem> WithCommandParameter <TCommandParameterTargetItem, TCommandParameterTargetItemValue>( TCommandParameterTargetItem targetItem, Expression <Func <TCommandParameterTargetItem, TCommandParameterTargetItemValue> > targetItemValue, ItemReferenceType referenceType) where TCommandParameterTargetItem : class { if (targetItem == null) { throw new ArgumentNullException(nameof(targetItem)); } if (targetItemValue == null) { throw new ArgumentNullException(nameof(targetItemValue)); } var targetItemReference = new ItemReference <TCommandParameterTargetItem>(targetItem, referenceType); var targetItemValueAccessor = new ItemValueAccessor <TCommandParameterTargetItem, TCommandParameterTargetItemValue>(targetItemValue); var targetItemCommandParameterBinding = new TargetItemPropertyBinding <TCommandParameterTargetItem, TCommandParameterTargetItemValue>( targetItemReference, targetItemValueAccessor); var targetItemCommandBinding = new TargetItemCommandBinding <TTargetItem, TTargetItemValue, TCommandParameterTargetItem, TCommandParameterTargetItemValue>( _compositeItemBinding.TargetItemBinding, targetItemCommandParameterBinding); return(new CompositeItemCommandBindingBuilder <TSourceItem, TSourceItemValue, TTargetItem, TCommandParameterTargetItemValue>( _compositeItemBinding.SourceItemBinding, targetItemCommandBinding, _bindingSet, _compositeItemBinding)); }
public ICompositeItemBindingBuilder <TSourceItem, TTargetItemValue> To <TSourceItemValue>( Expression <Func <TSourceItem, TSourceItemValue> > sourceItemValue) { SourceItemBinding <TSourceItem, TSourceItemValue> sourceItemBinding; try { var sourceItemValueAccessor = new ItemValueAccessor <TSourceItem, TSourceItemValue>(sourceItemValue); sourceItemBinding = new SourceItemPropertyBinding <TSourceItem, TSourceItemValue>( _sourceItemReference, sourceItemValueAccessor); } catch (Exception ex) { sourceItemBinding = new SourceItemEmptyBinding <TSourceItem, TSourceItemValue>( _sourceItemReference, typeof(SourceItemPropertyBinding <TSourceItem, TSourceItemValue>), sourceItemValue, ex); } return(new CompositeItemBindingBuilder <TSourceItem, TSourceItemValue, TTargetItem, TTargetItemValue>( sourceItemBinding, _targetItemBinding, _bindingSet)); }
public ICompositeItemCommandBindingBuilder <TSourceItem> To( Expression <Func <TSourceItem, FlexiMvvm.Commands.ICommand> > sourceItemValue) { var sourceItemValueAccessor = new ItemValueAccessor <TSourceItem, System.Windows.Input.ICommand>(sourceItemValue); var sourceItemBinding = new SourceItemCommandBinding <TSourceItem, object>( _sourceItemReference, sourceItemValueAccessor); return(new CompositeItemCommandBindingBuilder <TSourceItem, object, TTargetItem, TTargetItemValue>( sourceItemBinding, _targetItemBinding, _bindingSet)); }
internal CompositeItemBindingValueConverterParameterAccessor([NotNull] Expression <Func <TSourceItem, object> > sourceItemValue) { _sourceItemValueAccessor = new ItemValueAccessor <TSourceItem, object>(sourceItemValue); }