// TODO consolidate CreateOrGetDeepManager methods? Only diff is propGetter /// <summary> /// Creates a new NotificationChainManager for the given property, or returns an existing instance /// </summary> /// <typeparam name="T1"></typeparam> /// <param name="propGetter"></param> /// <returns></returns> internal NotificationChainManager CreateOrGetManager <T1> (Expression <Func <T1> > propGetter) where T1 : class { var propName = propGetter.GetPropertyOrFieldName(); NotificationChainManager mgr; if (!myDeepChainManagers.TryGetValue(propName, out mgr)) { myDeepChainManagers[propName] = mgr = new NotificationChainManager(); myDeepChainGetters[propName] = _ => propGetter.Compile().Invoke(); var currentValue = (T1)myDeepChainGetters[propName] (null); if (currentValue != null) { mgr.Observe(currentValue); } } return(mgr); }