diff --git a/src/Editor/Ghost.Editor/View/Controls/Docking/DockRegionHighlight.cs b/src/Editor/Ghost.Editor/View/Controls/Docking/DockRegionHighlight.cs
new file mode 100644
index 0000000..6478653
--- /dev/null
+++ b/src/Editor/Ghost.Editor/View/Controls/Docking/DockRegionHighlight.cs
@@ -0,0 +1,12 @@
+using Microsoft.UI.Xaml.Controls;
+
+namespace Ghost.Editor.View.Controls.Docking;
+
+public class DockRegionHighlight : Control
+{
+ public DockRegionHighlight()
+ {
+ DefaultStyleKey = typeof(DockRegionHighlight);
+ IsHitTestVisible = false;
+ }
+}
diff --git a/src/Editor/Ghost.Editor/View/Controls/Docking/DockRegionHighlight.xaml b/src/Editor/Ghost.Editor/View/Controls/Docking/DockRegionHighlight.xaml
new file mode 100644
index 0000000..99023f1
--- /dev/null
+++ b/src/Editor/Ghost.Editor/View/Controls/Docking/DockRegionHighlight.xaml
@@ -0,0 +1,15 @@
+
+
+
+
diff --git a/src/Editor/Ghost.Editor/View/Controls/Docking/DockingLayout.cs b/src/Editor/Ghost.Editor/View/Controls/Docking/DockingLayout.cs
new file mode 100644
index 0000000..97754ff
--- /dev/null
+++ b/src/Editor/Ghost.Editor/View/Controls/Docking/DockingLayout.cs
@@ -0,0 +1,67 @@
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+
+namespace Ghost.Editor.View.Controls.Docking;
+
+[TemplatePart(Name = "PART_Content", Type = typeof(ContentPresenter))]
+[TemplatePart(Name = "PART_OverlayCanvas", Type = typeof(Canvas))]
+[TemplatePart(Name = "PART_Highlight", Type = typeof(DockRegionHighlight))]
+public class DockingLayout : Control
+{
+ public static readonly DependencyProperty RootPanelProperty = DependencyProperty.Register(
+ nameof(RootPanel), typeof(DockPanel), typeof(DockingLayout), new PropertyMetadata(null, OnRootPanelChanged));
+
+ public DockPanel? RootPanel
+ {
+ get => (DockPanel?)GetValue(RootPanelProperty);
+ set => SetValue(RootPanelProperty, value);
+ }
+
+ private Canvas? _overlayCanvas;
+ private DockRegionHighlight? _highlight;
+
+ public DockingLayout()
+ {
+ DefaultStyleKey = typeof(DockingLayout);
+ }
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+ _overlayCanvas = GetTemplateChild("PART_OverlayCanvas") as Canvas;
+ _highlight = GetTemplateChild("PART_Highlight") as DockRegionHighlight;
+ }
+
+ private static void OnRootPanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is DockingLayout layout && e.NewValue is DockPanel panel)
+ {
+ panel.Root = layout;
+ }
+ }
+
+ public void AddDocument(DockDocument document, DockTarget target, DockGroup? targetGroup = null)
+ {
+ if (RootPanel == null)
+ {
+ RootPanel = new DockPanel();
+ }
+
+ if (targetGroup == null)
+ {
+ if (RootPanel.Children.Count == 0)
+ {
+ var group = new DockGroup();
+ group.AddChild(document);
+ RootPanel.AddChild(group);
+ return;
+ }
+ targetGroup = RootPanel.Children[0] as DockGroup;
+ }
+
+ if (targetGroup != null)
+ {
+ targetGroup.AddChild(document);
+ }
+ }
+}
diff --git a/src/Editor/Ghost.Editor/View/Controls/Docking/DockingLayout.xaml b/src/Editor/Ghost.Editor/View/Controls/Docking/DockingLayout.xaml
new file mode 100644
index 0000000..0604214
--- /dev/null
+++ b/src/Editor/Ghost.Editor/View/Controls/Docking/DockingLayout.xaml
@@ -0,0 +1,20 @@
+
+
+
+