diff --git a/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockGroupNode.cs b/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockGroupNode.cs
index ed0ebc8..909cbf3 100644
--- a/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockGroupNode.cs
+++ b/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockGroupNode.cs
@@ -4,19 +4,38 @@ using Microsoft.UI.Xaml.Controls;
namespace Ghost.Editor.Core.Controls.Internal.Docking;
+///
+/// A docking node that contains multiple children and arranges them in a specific orientation.
+///
public partial class DockGroupNode : DockNode
{
+ ///
+ /// Gets or sets the layout orientation of the children.
+ ///
[ObservableProperty]
public partial Orientation Orientation { get; set; }
+ ///
+ /// Gets the collection of child nodes.
+ ///
+ public ObservableCollection Children { get; } = new();
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
public DockGroupNode()
{
Orientation = Orientation.Horizontal;
}
- public ObservableCollection Children { get; } = new();
-
+ ///
+ /// Adds a child node to this group, enforcing tree invariants.
+ ///
+ /// The node to add.
+ /// Thrown if node is null.
+ /// Thrown if adding the node would create a cycle or if adding self.
public void AddChild(DockNode node)
+
{
ArgumentNullException.ThrowIfNull(node);
@@ -50,6 +69,10 @@ public partial class DockGroupNode : DockNode
Children.Add(node);
}
+ ///
+ /// Removes a child node from this group.
+ ///
+ /// The node to remove.
public void RemoveChild(DockNode node)
{
if (Children.Remove(node))
diff --git a/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockNode.cs b/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockNode.cs
index 795e754..3b31ab0 100644
--- a/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockNode.cs
+++ b/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockNode.cs
@@ -2,8 +2,14 @@ using CommunityToolkit.Mvvm.ComponentModel;
namespace Ghost.Editor.Core.Controls.Internal.Docking;
+///
+/// Base class for all nodes in the docking layout tree.
+///
public abstract partial class DockNode : ObservableObject
{
+ ///
+ /// Gets the parent group of this node.
+ ///
[ObservableProperty]
- public partial DockGroupNode? Parent { get; set; }
+ public partial DockGroupNode? Parent { get; internal set; }
}
diff --git a/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockPanelNode.cs b/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockPanelNode.cs
index f7906da..f699cc8 100644
--- a/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockPanelNode.cs
+++ b/src/Editor/Ghost.Editor.Core/Controls/Internal/Docking/DockPanelNode.cs
@@ -3,16 +3,31 @@ using CommunityToolkit.Mvvm.ComponentModel;
namespace Ghost.Editor.Core.Controls.Internal.Docking;
+///
+/// A docking node that contains a collection of items (tabs) and manages selection.
+///
public partial class DockPanelNode : DockNode
{
+ ///
+ /// Gets the collection of items (tabs) in this panel.
+ ///
public ObservableCollection