/// <summary> /// Registers an observable factory for the specified type and property. /// </summary> /// <param name="type">Type.</param> /// <param name="property">Property.</param> /// <param name="affinity">Affinity.</param> /// <param name="createObservable">Create observable.</param> protected void Register(Type type, string property, int affinity, Func <NSObject, Expression, IObservable <IObservedChange <object, object> > > createObservable) { if (!_config.TryGetValue(type, out Dictionary <string, ObservablePropertyInfo> typeProperties)) { typeProperties = new Dictionary <string, ObservablePropertyInfo>(); _config[type] = typeProperties; } typeProperties[property] = new ObservablePropertyInfo { Affinity = affinity, CreateObservable = createObservable }; }
/// <summary> /// Registers an observable factory for the specified type and property. /// </summary> /// <param name="type">Type.</param> /// <param name="property">Property.</param> /// <param name="createObservable">Create observable.</param> protected void Register(Type type, string property, int affinity, Func<NSObject, Expression, IObservable<IObservedChange<object, object>>> createObservable) { Dictionary<string, ObservablePropertyInfo> typeProperties; if(!config.TryGetValue(type, out typeProperties)) { typeProperties = new Dictionary<string, ObservablePropertyInfo>(); config[type] = typeProperties; } var info = new ObservablePropertyInfo { Affinity = affinity, CreateObservable = createObservable }; typeProperties[property] = info; }