public void Reset() { var children = new List <UIElement>(Children); foreach (var child in children) { Remove(child); } LastSelected = null; }
public void Select(Point at) { var item = (int)(at.X + Scroll) / ItemWidth; if (item >= LengthProvider()) { return; } var rItem = GetOrPrepare(item); if (rItem != null) { LastSelected?.Deselected(); rItem.Selected(); LastSelected = rItem; } }
public UITSContainer GetOrPrepare(int id) { var item = Children.Where(x => (x as UITSContainer)?.ItemID == id).FirstOrDefault() as UITSContainer; if (item == null) { item = ElemProvider(id); item.Visible = false; item.ItemID = id; if (id == LastSelected?.ItemID) { item.Selected(); LastSelected = item; } Add(item); } return(item); }