private bool UpdateTargetWithStartingValue(WeakReference <IPropBagInternal> bindingTarget, StoreNodeProp sourcePropNode) { bool result; if (NoTarget_NotifiesReceiverInstead) { //WeakReference<IPropBagInternal> propItemParentPropBag_internal = sourcePropNode?.Parent?.PropBagProxy; //WeakReference<IPropBag> propItemParentPropBag = GetPublicVersion(propItemParentPropBag_internal); WeakReference <IPropBag> propItemParentPropBag_wr = GetPropItemParent(_propStoreAccessService_wr, sourcePropNode); result = NotifyReceiver(_storeNodeUpdateReceiver, propItemParentPropBag_wr); } else { IProp typedProp = sourcePropNode.PropData_Internal.TypedProp; if (typedProp.StorageStrategy == PropStorageStrategyEnum.Internal) { T newValue = (T)typedProp.TypedValueAsObject; result = UpdateTarget(_targetObject, newValue); } else { // This property has no backing store, there is no concept of a starting value. (Propably used to send messages.) result = false; } } return(result); }
private WeakReference <IPropBag> GetPropItemParent(WeakReference <PSAccessServiceInterface> propStoreAccessService_wr, StoreNodeProp sourcePropNode) { if (propStoreAccessService_wr.TryGetTarget(out PSAccessServiceInterface storeAccessor)) { if (storeAccessor is PSAccessServiceInternalInterface storeAcessor_internal) { WeakReference <IPropBagInternal> propItemParentPropBag_internal_wr = storeAcessor_internal.GetPropBagProxy(sourcePropNode); WeakReference <IPropBag> propItemParentPropBag_wr = storeAcessor_internal.GetPublicInterface(propItemParentPropBag_internal_wr); return(propItemParentPropBag_wr); } else { return(new WeakReference <IPropBag>(null)); } } else { return(new WeakReference <IPropBag>(null)); } }
private bool TryGetChildProp(StoreNodeBag objectNode, IPropBagInternal propBag, string propertyName, out StoreNodeProp child) { PropIdType propId = ((PSAccessServiceInternalInterface)propBag.ItsStoreAccessor).Level2KeyManager.FromRaw(propertyName); bool result = objectNode.TryGetChild(propId, out child); return(result); }