public void Register(object target, string path, IDataBinding binding, IDataContext context = null) { _bindingManager.Register(target, path, binding, context); lock (_bindings) _bindings.Add(new WeakReference(binding, true)); ++BindingCount; }
public object Get(Type service) { IBinding binding = null; if (_bindingManager.HasBinding(service)) { binding = _bindingManager.GetBinding(service); } if (binding == null) { binding = _bindingDiscoverer.Discover(service); if (binding != null) { _bindingManager.Register(binding); } } return(binding != null?Activate(binding) : null); }