Esempio n. 1
0
        public void Reset()
        {
            var children = new List <UIElement>(Children);

            foreach (var child in children)
            {
                Remove(child);
            }
            LastSelected = null;
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
        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);
        }