fix(dock): complete TabTearOffService migration and restore transactional integrity

This commit is contained in:
2026-03-28 17:23:49 +09:00
parent 0a0359ec06
commit 7ac9a66110
4 changed files with 8 additions and 12 deletions

View File

@@ -436,8 +436,13 @@ public sealed partial class DockLayout : Control
{
var result = TabTearOffService.TryTearOffTab(sourceNode.Items, args.Item, (tab) =>
{
if (TabTornOff == null)
{
throw new InvalidOperationException("No tear-off handler attached.");
}
// Raise event to let the host handle window creation
TabTornOff?.Invoke(this, new TabTornOffEventArgs(tab, sourceNode));
TabTornOff.Invoke(this, new TabTornOffEventArgs(tab, sourceNode));
}, sourceNode);
if (result.IsSuccess)