Example #1
0
 public ConvertingAdapter(IValueAdapter targetAdapter, IValueConverter converter)
 {
     if (converter == null)
     {
         throw new ArgumentNullException("converter");
     }
     if (targetAdapter == null)
     {
         throw new ArgumentNullException("targetAdapter");
     }
     _converter     = converter;
     _targetAdapter = targetAdapter;
     _targetAdapter.ValueChangedCallback = OnSourceAdapterValueChanged;
 }
 public ModelFormulaExpression(
     String name,
     TModel model,
     IModelFormula <TModel, TValue> formula,
     IValueAdapter <TValue> adapter,
     Func <ModelFormulaExpression <TModel, TValue>, CalculationTicket, IEnumerable <IValidationIssue> > validator
     )
 {
     this.Name      = name;
     this.Model     = model;
     this.Formula   = formula;
     this.Adapter   = adapter;
     this.validator = validator;
 }
Example #3
0
 public ValueBinding(IValueAdapter targetAdapter, IValueAdapter sourceAdapter)
 {
     if (targetAdapter == null)
     {
         throw new ArgumentNullException("targetAdapter");
     }
     if (sourceAdapter == null)
     {
         throw new ArgumentNullException("sourceAdapter");
     }
     _targetAdapter = targetAdapter;
     _sourceAdapter = sourceAdapter;
     _targetAdapter.ValueChangedCallback = _sourceAdapter.SetValue;
     _sourceAdapter.ValueChangedCallback = ForwardValueToTargetIfNotNoValue;
 }
 public DataContextPropertyAdapter(FrameworkElement target, string propertyInDataContext)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (propertyInDataContext == null)
     {
         throw new ArgumentNullException("propertyInDataContext");
     }
     _propertyInDataContext = propertyInDataContext;
     _dataContextAdapter    = ValueAdapterFactory.CreateAdapterForDependencyProperty(target, FrameworkElement.DataContextProperty);
     _dataContextAdapter.ValueChangedCallback = OnDataContextChanged;
     _valueChangedCallback = newValue => { };
     _valueAdapter         = CreateValueAdapter();
 }
Example #5
0
 protected CollectionBindingBase(
     ICollectionAdapter targetAdapter,
     IValueAdapter sourceAdapter)
 {
     if (targetAdapter == null)
     {
         throw new ArgumentNullException("targetAdapter");
     }
     if (sourceAdapter == null)
     {
         throw new ArgumentNullException("sourceAdapter");
     }
     _targetAdapter = targetAdapter;
     _sourceAdapter = sourceAdapter;
     _sourceAdapter.ValueChangedCallback      = OnSourceValueChangedCallback;
     _targetAdapter.CollectionChangedCallback = OnTargetCollectionChangedCallback;
 }
Example #6
0
 private static IValueAdapter ConvertSourceToType(IValueAdapter adapter, Type sourceTargetType)
 {
     return(new ConvertingAdapter(adapter, new SourceValueConverter(sourceTargetType)));
 }
Example #7
0
 public SynchronizationAdapter(IValueAdapter valueAdapter, SynchronizationGroup synchronizationGroup)
 {
     _valueAdapter = valueAdapter;
     _valueAdapter.ValueChangedCallback = OnValueAdapterValueChanged;
     _synchronizationGroup = synchronizationGroup;
 }
Example #8
0
 public void WriteValue <TValue>(string name, TValue value, IValueAdapter <TValue> adapter)
 {
 }
 private void ClearValueAdapter()
 {
     Dispose(_valueAdapter);
     _valueAdapter = null;
 }
Example #10
0
 public ValueBindingBuilder SetTargetAdapter(IValueAdapter adapter)
 {
     _targetAdapter = adapter;
     return(this);
 }
Example #11
0
 private IValueAdapter DecorateTargetAdapter(IValueAdapter targetAdapter, DataGridColumn column, int columnIndex, DependencyProperty property)
 {
     return(TargetAdapterDecorator == null
         ? targetAdapter
         : TargetAdapterDecorator(targetAdapter, column, columnIndex, property));
 }
Example #12
0
 public ListBinding(
     ICollectionAdapter targetAdapter,
     IValueAdapter sourceAdapter)
     : base(targetAdapter, sourceAdapter)
 {
 }
 public void WriteValue <TValue>(String name, TValue value, IValueAdapter <TValue> adapter)
 {
     Trace.WriteLine(name + ": " + value);
 }