Inheritance: DelegatedPropertyInfo
 public ObjectPropertyAtom(IObjectInstance objectInstance, ClassProperty classProperty)
     : base(objectInstance, classProperty)
 {
     if (ClassProperty.CanRead)
     {
         // When the property is out of date, update it from the wrapped object.
         _depProperty = new Dependent(delegate
         {
             object value = ClassProperty.GetObjectValue(ObjectInstance.Model, ObjectInstance.ViewModel);
             object translatedValue = TranslateOutgoingValue(value);
             bool changed = !Object.Equals(_value, translatedValue);
             _value = translatedValue;
             if (changed && _firePropertyChanged)
                 ObjectInstance.FirePropertyChanged(ClassProperty.Name);
             _firePropertyChanged = true;
         });
         // When the property becomes out of date, trigger an update.
         Action triggerUpdate = new Action(delegate
         {
             ObjectInstance.Dispatcher.BeginInvoke(new Action(delegate
             {
                 using (NotificationGate.BeginOutbound())
                 {
                     _depProperty.OnGet();
                 }
             }));
         });
         _depProperty.Invalidated += triggerUpdate;
     }
 }
        public ObjectPropertyCollection(IObjectInstance objectInstance, ClassProperty classProperty)
            : base(objectInstance, classProperty)
        {
            if (ClassProperty.CanRead)
            {
                // When the collection is out of date, update it from the wrapped object.
                _depCollection = new Dependent(OnUpdateCollection);

                // When the property becomes out of date, trigger an update.
                _depCollection.Invalidated += TriggerUpdate;
            }
        }
 public ObjectPropertyAtomNative(IObjectInstance objectInstance, ClassProperty classProperty)
     : base(objectInstance, classProperty)
 {
 }
Exemplo n.º 4
0
 public static ObjectProperty From(IObjectInstance objectInstance, ClassProperty classProperty)
 {
     return classProperty.MakeObjectProperty(objectInstance);
 }
Exemplo n.º 5
0
 public ObjectProperty(IObjectInstance objectInstance, ClassProperty classProperty)
 {
     ObjectInstance = objectInstance;
     ClassProperty = classProperty;
 }
 public ObjectPropertyCollectionNative(IObjectInstance objectInstance, ClassProperty classProperty)
     : base(objectInstance, classProperty)
 {
 }