2 using System.Collections.Generic;
4 namespace Tizen.NUI.Binding
7 /// Helper that handles storing and lookup of platform specifics implementations
9 /// <typeparam name="TElement">The Element type</typeparam>
10 internal class PlatformConfigurationRegistry<TElement> : IElementConfiguration<TElement>
11 where TElement : Element
13 readonly TElement _element;
14 readonly Dictionary<Type, object> _platformSpecifics = new Dictionary<Type, object>();
16 internal PlatformConfigurationRegistry(TElement element)
22 public IPlatformElementConfiguration<T, TElement> On<T>() where T : IConfigPlatform
24 if (_platformSpecifics.ContainsKey(typeof(T)))
26 return (IPlatformElementConfiguration<T, TElement>)_platformSpecifics[typeof(T)];
29 var emptyConfig = Configuration<T, TElement>.Create(_element);
31 _platformSpecifics.Add(typeof(T), emptyConfig);