feat(docking): add core enums and base classes

This commit is contained in:
2026-03-28 21:43:30 +09:00
parent 5f0eea49cf
commit 47ffc01524
3 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using System.Collections.ObjectModel;
namespace Ghost.Editor.View.Controls.Docking;
public abstract class DockContainer : DockModule
{
public ObservableCollection<DockModule> Children { get; } = new();
protected DockContainer()
{
Children.CollectionChanged += OnChildrenChanged;
}
private void OnChildrenChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (e.OldItems != null)
{
foreach (DockModule module in e.OldItems)
{
module.Owner = null;
}
}
if (e.NewItems != null)
{
foreach (DockModule module in e.NewItems)
{
module.Owner = this;
// module.Root = Root;
}
}
OnChildrenUpdated();
}
protected virtual void OnChildrenUpdated() { }
}