fix(dock): fix build break and clean up logging/event patterns

This commit is contained in:
2026-03-28 17:38:07 +09:00
parent 287b3b303f
commit c77592d479
3 changed files with 8 additions and 2 deletions

View File

@@ -72,7 +72,6 @@ public partial class App : Application
app._secondaryWindows.Remove(newWindow);
}
newWindow.Close();
Logger.LogError(ex);
throw;
}
}

View File

@@ -442,8 +442,14 @@ public sealed partial class DockLayout : Control
var result = TabTearOffService.TryTearOffTab(sourceNode.Items, args.Item, (tab) =>
{
var handler = TabTornOff;
if (handler == 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));
handler.Invoke(this, new TabTornOffEventArgs(tab, sourceNode));
}, sourceNode);
if (result.IsSuccess)

View File

@@ -5,6 +5,7 @@ using Ghost.Editor.Core.Services;
using Ghost.Editor.Core.Controls.Internal.Docking;
using Ghost.Editor.View.Controls;
using Ghost.Editor.ViewModels.Windows;
using Microsoft.UI.Xaml;
using Windows.ApplicationModel;
using WinUIEx;