补充处理窗体注销的逻辑。

修复部分 激活流程的问题。
This commit is contained in:
2026-06-16 17:52:15 +08:00
parent 6b22c13921
commit 8dfcaba43a
5 changed files with 267 additions and 207 deletions
+14
View File
@@ -61,6 +61,20 @@ namespace XericUI.VisualForm
}
protected void OnDisable()
{
UnregisterFromDock();
}
protected void OnDestroy()
{
UnregisterFromDock();
}
/// <summary>
/// 从锚点坞或待注册列表中注销此锚点。
/// OnDisable 和 OnDestroy 共用,确保所有退出路径都执行清理。
/// </summary>
private void UnregisterFromDock()
{
if (m_TargetDock != null)
m_TargetDock.RemoveAnchor(this);