private void RemoveItemsFromCollection()
        {
            var            names          = _collectionItems.GetSelection().Select(id => _collectionItems.Root.Find(id).Name);
            CollectionData collectionData = _selectedItem.CollectionData;
            var            itemNames      = collectionData.ItemNames.Except(names).ToArray();

            RecordUndo($"Remove {itemNames.Length} item(s) from collection {collectionData.Name}");

            _selectedItem.CollectionData.ItemNames = itemNames.Distinct().ToArray();
            _collectionItems.SetSelection(new List <int>());
            RebuildItemLists();
        }
        private void AddItemsToCollection()
        {
            var names          = _availableItems.GetSelection().Select(id => _availableItems.Root.Find(id).Name);
            var collectionData = _selectedItem.CollectionData;
            var itemNames      = collectionData.ItemNames?.ToList() ?? new List <string>();

            itemNames.AddRange(names);

            RecordUndo($"Add {itemNames.Count} item(s) to collection {collectionData.Name}");

            collectionData.ItemNames = itemNames.Distinct().ToArray();
            _availableItems.SetSelection(new List <int>());
            RebuildItemLists();
        }