Exemplo n.º 1
0
        /// <summary>
        /// Initialize the binding instance.
        /// </summary>
        /// <param name='target'>
        /// The target object to bind to.
        /// </param>
        /// <param name='targetProperty'>
        /// The name of the Target property.
        /// </param>
        /// <param name='source'>
        /// The Source object to bind to.
        /// </param>
        /// <param name='binding'>
        /// The source Binding.
        /// </param>
        private void Initialize(object target, string targetProperty, object source, Binding binding)
        {
            this.target = new WeakReference(target);
            this.source = new WeakReference(source);
            this.TargetProperty = targetProperty;
            this.Binding = binding;

            this.RegisterForPropertyChangesOnSource();
            this.RegisterForPropertyChangesOnTarget();
            
            this.targetPropertyInfo = target.GetPropertyInfo(this.TargetProperty);
            
            this.UpdateTarget();
        }