Exemple #1
0
        public Binding(Expression <Func <TTarget, TIn> > source, Action <TTarget, TIn> setter, TTarget target)
            : base(target)
        {
            _in     = source.Compile();
            _setter = setter;
            Set();

            AddObservers(
                PropertyPaths <TTarget> .Get(source)
                .Select(p => new PropertyPathObserver <TTarget>(p, target)));
        }
Exemple #2
0
        public Binding(Expression <Func <TTarget, TIn1> > in1, Expression <Func <TTarget, TIn2> > in2, Action <TTarget, TIn1, TIn2> setter, TTarget target)
            : base(target)
        {
            _in1    = in1.Compile();
            _in2    = in2.Compile();
            _setter = setter;
            Set();

            AddObservers(
                PropertyPaths <TTarget> .Get(in1)
                .Select(p => new PropertyPathObserver <TTarget>(p, target)));

            AddObservers(
                PropertyPaths <TTarget> .Get(in2)
                .Select(p => new PropertyPathObserver <TTarget>(p, target)));
        }