Пример #1
0
 protected override void Dispose(bool disposing)
 {
     if (!disposed)
     {
         this.DisposeSourceProxy();
         this.DisposeTargetProxy();
         this.bindingDescription = null;
         disposed = true;
         base.Dispose(disposing);
     }
 }
Пример #2
0
        protected void CreateTargetProxy(object target, BindingDescription description)
        {
            this.DisposeTargetProxy();

            this.targetProxy = this.targetProxyFactory.CreateProxy(target, description);

            if (this.IsSubscribeTargetValueChanged(this.BindingMode) && this.targetProxy is INotifiable)
            {
                this.targetValueChangedHandler = (sender, args) => this.UpdateSourceFromTarget();
                (this.targetProxy as INotifiable).ValueChanged += this.targetValueChangedHandler;
            }
        }
Пример #3
0
        public Binding(IBindingContext bindingContext, object source, object target, BindingDescription bindingDescription, ISourceProxyFactory sourceProxyFactory, ITargetProxyFactory targetProxyFactory) : base(bindingContext, source, target)
        {
            this.targetTypeName     = target.GetType().Name;
            this.bindingDescription = bindingDescription;

            this.converter          = bindingDescription.Converter;
            this.sourceProxyFactory = sourceProxyFactory;
            this.targetProxyFactory = targetProxyFactory;

            this.CreateTargetProxy(target, this.bindingDescription);
            this.CreateSourceProxy(this.DataContext, this.bindingDescription.Source);
            this.UpdateDataOnBind();
        }
 public IBinding Create(IBindingContext bindingContext, object source, object target, BindingDescription bindingDescription)
 {
     return(new Binding(bindingContext, source, target, bindingDescription, this.sourceProxyFactory, this.targetProxyFactory));
 }