示例#1
0
        internal async Task UpdateActivatedItem(MudTreeViewItem <T> item, bool requestedValue)
        {
            if ((_activatedValue == item && requestedValue) ||
                (_activatedValue != item && !requestedValue))
            {
                return;
            }

            if (_activatedValue == item && !requestedValue)
            {
                _activatedValue = default;
                await item.Activate(requestedValue);

                await ActivatedValueChanged.InvokeAsync(_activatedValue.Value);

                return;
            }

            if (_activatedValue != null)
            {
                await _activatedValue.Activate(false);
            }

            _activatedValue = item;
            await item?.Activate(requestedValue);

            await ActivatedValueChanged.InvokeAsync(item.Value);
        }
示例#2
0
 internal void AddChild(MudTreeViewItem <T> item) => _childItems.Add(item);