Esempio n. 1
0
        protected override void performRebuild()
        {
            _childWidgets.Clear();
            base.performRebuild();
            if (_childElements.isEmpty())
            {
                return;
            }

            int firstIndex = _childElements.First()?.Key ?? 0;
            int lastIndex  = _childElements.Last()?.Key ?? _childElements.Count;

            for (int index = firstIndex; index <= lastIndex; ++index)
            {
                Element newChild = updateChild(_childElements[index], retrieveWidget(index), index);
                if (newChild != null)
                {
                    _childElements[index] = newChild;
                }
                else
                {
                    _childElements.Remove(index);
                }
            }
        }
Esempio n. 2
0
        protected override void performRebuild()
        {
            _childWidgets.Clear();
            base.performRebuild();
            if (_childElements.isEmpty())
            {
                return;
            }

            var firstIndex = _childElements.First()?.Key ?? 0;
            var lastIndex  = _childElements.Last()?.Key ?? _childElements.Count;

            for (var index = firstIndex; index <= lastIndex; ++index)
            {
                var newChild = updateChild(_childElements[key: index], retrieveWidget(index: index), newSlot: index);
                if (newChild != null)
                {
                    _childElements[key : index] = newChild;
                }
                else
                {
                    _childElements.Remove(key: index);
                }
            }
        }