示例#1
0
        private KNBinding(
            string targetKeyPath,
            object target,
            string sourceKeyPath, 
            object source, 
            object nullValuePlaceholder,
            KNValueTransformer transformer
            )
        {
            ignoreSourceKVO = false;
                ignoreTargetKVO = false;

                TargetKeyPath = targetKeyPath;
                Target = target;
                SourceKeyPath = sourceKeyPath;
                Source = source;
                NullPlaceHolder = nullValuePlaceholder;
                ValueTransformer = transformer;

                Source.AddObserverToKeyPathWithOptions(
                    this,
                    SourceKeyPath,
                    KNKeyValueObservingOptions.KNKeyValueObservingOptionInitial,
                    kKNBindingInternalObservationContext
                    );

                Target.AddObserverToKeyPathWithOptions(
                    this,
                    TargetKeyPath,
                    KNKeyValueObservingOptions.KNKeyValueObservingOptionNone,
                    kKNBindingInternalObservationContext
                    );
        }
示例#2
0
 public static void BindKeyPathOfTargetToKeyPathOfSource(
     string targetKeyPath,
     object target,
     string sourceKeyPath, 
     object source, 
     KNValueTransformer transformer
     )
 {
     bindings.Add(new KNBinding(targetKeyPath, target, sourceKeyPath, source, null, transformer));
 }