using System.Windows;
using System.Windows.Controls;
using CommunityToolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;

namespace CtrEditor.PopUps
{


    // StyleSelector para TreeViewItems
    public class LibraryTreeItemStyleSelector : StyleSelector
    {
        public Style DirectoryStyle { get; set; }

        public override Style SelectStyle(object item, DependencyObject container)
        {
            if (item is LibraryTreeNode node && node.IsDirectory)
            {
                return DirectoryStyle;
            }
            return null;
        }
    }

    // Clase para nodos del TreeView jerárquico
    public class LibraryTreeNode : ObservableObject
    {
        public string DisplayName { get; set; }
        public bool IsDirectory { get; set; }
        public bool IsCurrentProject { get; set; }
        public string DirectoryPath { get; set; }
        public LibraryItem Library { get; set; }
        public ObservableCollection<LibraryTreeNode> Children { get; set; } = new ObservableCollection<LibraryTreeNode>();
    }

    // Wrapper para objetos seleccionables
    public class SelectableObjectWrapper : ObservableObject
    {
        public CtrEditor.ObjetosSim.osBase Object { get; set; }

        private bool _isSelected;
        public bool IsSelected
        {
            get => _isSelected;
            set => SetProperty(ref _isSelected, value);
        }
    }
}