protected override void Dispose(bool disposing) { if (!disposed) { this.DisposeSourceProxy(); this.DisposeTargetProxy(); this.bindingDescription = null; disposed = true; base.Dispose(disposing); } }
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; } }
public Binding(object source, object target, BindingDescription bindingDescription, ISourceProxyFactory sourceProxyFactory, ITargetProxyFactory targetProxyFactory) : base(source, target) { this.bindingDescription = bindingDescription; this.converter = bindingDescription.Converter; this.sourceProxyFactory = sourceProxyFactory; this.targetProxyFactory = targetProxyFactory; this.CreateTargetProxy(this.Target, this.bindingDescription); this.CreateSourceProxy(this.DataContext, this.bindingDescription.Source); this.UpdateDataOnBind(); }
public static void AddBinding(this Behaviour behaviour, BindingDescription bindingDescription) { behaviour.BindingContext().Add(behaviour, bindingDescription); }
public static void AddBinding(this Behaviour behaviour, object target, BindingDescription bindingDescription, object key = null) { behaviour.BindingContext().Add(target, bindingDescription, key); }
public IBinding Create(object source, object target, BindingDescription bindingDescription) { return(new Binding(source, target, bindingDescription, this.sourceProxyFactory, this.targetProxyFactory)); }