fix(docking): enforce DockDocument children in DockGroup and fix style

This commit is contained in:
2026-03-28 21:58:21 +09:00
parent 332a940993
commit 09576bb6e1
2 changed files with 12 additions and 3 deletions

View File

@@ -1,6 +1,5 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
namespace Ghost.Editor.View.Controls.Docking;
@@ -16,6 +15,16 @@ public partial class DockGroup : DockContainer
DefaultStyleKey = typeof(DockGroup);
}
public override void AddChild(DockModule module)
{
if (module is not DockDocument)
{
throw new ArgumentException($"{nameof(DockGroup)} only accepts {nameof(DockDocument)} children.", nameof(module));
}
base.AddChild(module);
}
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();