Ejemplo n.º 1
0
        public Binding(PublishedValue <FromType> fromValue, PublishedValue <ToType> toValue)
        {
            if (null == fromValue || null == toValue)
            {
                return;
            }

            toValue.Value = Transform(fromValue.Value);

            // Avoid strong reference captures (binding doesn't claim ownership of objects it binds to)
            this.fromValue = new WeakReference <PublishedValue <FromType> >(fromValue);
            fromValue.AddListener(this);

            this.toValue = new WeakReference <PublishedValue <ToType> >(toValue);
        }