using System.Collections.ObjectModel; using System.Collections.Specialized; // ReSharper disable once CheckNamespace namespace WPFluent.Controls; /// /// TODO: Work in progress. /// public class TreeGrid : System.Windows.Controls.Primitives.Selector { /// /// Identifies the dependency property. /// public static readonly DependencyProperty HeadersProperty = DependencyProperty.Register( nameof(Headers), typeof(ObservableCollection), typeof(TreeGrid), new PropertyMetadata(null)); /*/// /// Content is the data used to generate the child elements of this control. /// [Bindable(true)] public object Content { get => GetValue(ContentProperty); set => SetValue(ContentProperty, value); }*/ public TreeGrid() { Headers = []; Headers.CollectionChanged += Headers_CollectionChanged; /* var x = new System.Windows.Controls.ContentControl(); var y = new System.Windows.Controls.ItemsControl(); var z = new System.Windows.Controls.ListBox(); */ } private void Headers_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { throw new NotImplementedException(); } /*/// /// Add an object child to this control /// void IAddChild.AddChild(object value) { AddChild(value); } public void AddText(string text) { throw new NotImplementedException(); } /// /// Add an object child to this control /// protected virtual void AddChild(object value) { // if conent is the first child or being cleared, set directly if (Content == null || value == null) Content = value; else throw new InvalidOperationException($"{typeof(TreeGrid)} cannot have multiple content"); }*/ protected virtual void OnHeadersChanged(DependencyPropertyChangedEventArgs e) { // Headers changed } /* /// /// Property for . /// public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(nameof(Content), typeof(object), typeof(TreeGrid), new PropertyMetadata(null, OnContentChanged)); */ /// /// Gets or sets the data used to generate the child elements of this control. /// [Bindable(true)] public ObservableCollection? Headers { get => GetValue(HeadersProperty) as ObservableCollection; set => SetValue(HeadersProperty, value); } /* protected virtual void OnContentChanged(DependencyPropertyChangedEventArgs e) { // Content changed } */ /* private static void OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is not TreeGrid treeGrid) { return; } treeGrid.OnContentChanged(e); } */ }