public IObjectWrapper Get(string id) { NUIViewWrapper wrapper = null; _list.TryGetValue(id, out wrapper); if (wrapper == null) { wrapper = _list.Where(kv => (string)kv.Value.GetPropertyValue("AutomationId") == id).FirstOrDefault().Value; } if (wrapper != null && wrapper.IsShown) { return(wrapper); } return(null); }
public void Add(object element) { NUIViewWrapper wrapper; if (element is View v) { wrapper = new NUIViewWrapper(v); } else { return; } if (_list.TryAdd(wrapper.Id, wrapper)) { wrapper.Deleted += (s, e) => { RemoveById(wrapper.Id); }; Log.Debug("[Added][object] id=" + wrapper.Id + ", type=" + element?.GetType() + ", list.Count=" + _list.Count); } }