Esempio n. 1
0
        private static void BindTargetToSource(ObserveDefinition assignment, object context, Layout targetObj)
        {
            var sourceProp     = context.GetType().GetRuntimeProperty(assignment.ObservableName);
            var sourceObs      = (IObserver <object>)sourceProp.GetValue(context);
            var targetProperty = targetObj.GetProperty(assignment.AssignmentMember.MemberName);
            var observer       = targetObj.GetChangedObservable(targetProperty);

            observer.Subscribe(sourceObs);
        }
Esempio n. 2
0
        private static void BindToObservable(ObserveDefinition definition)
        {
            var targetObj = (Layout)definition.TargetInstance;
            var obs       = targetObj.GetChangedObservable(Layout.DataContextProperty);

            obs.Where(o => o != null)
            .Subscribe(context =>
            {
                BindSourceObservableToTarget(definition, context, targetObj);
                //BindTargetToSource(definition, context, targetObj);
            });
        }