Exception:在 Window 关闭时,无法将 Visibility 设置为 Visible,也无法调用 Show、ShowDialog、Close 或 WindowInteropHelper.EnsureHandle。

报错信息 1
InvalidOperationException: 在 Window 关闭时,无法将 Visibility 设置为 Visible,也无法调用 Show、ShowDialog、Close 或 WindowInteropHelper.EnsureHandle。
StackTrace:
   在 System.Windows.Window.VerifyNotClosing()
   在 System.Windows.Window.InternalClose(Boolean shutdown, Boolean ignoreCancel)
   在 System.Windows.Window.OnDeactivated(EventArgs e)
   在 System.Windows.Window.HandleActivate(Boolean windowActivated)
   在 System.Windows.Window.WmActivate(IntPtr wParam)
   在 System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

版本:1.45.5 2026-10-28 17:08 Microsoft Windows NT 10.0.26200.0
版本:1.45.5 2026-10-24 15:54 Microsoft Windows NT 10.0.26300.0
版本:1.45.5 2026-10-24 15:43 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-10-24 13:52 Microsoft Windows NT 6.1.7601 Service Pack 1
版本:1.45.5 2026-10-21 08:48 Microsoft Windows NT 10.0.22621.0
版本:1.45.5 2026-10-20 18:26 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-10-19 08:41 Microsoft Windows NT 10.0.22631.0
版本:1.45.5 2026-10-17 00:03 Microsoft Windows NT 10.0.22631.0
版本:1.45.5 2026-10-15 11:36 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-10-10 14:35 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-10-09 11:47 Microsoft Windows NT 10.0.19044.0
版本:1.45.5 2026-10-09 09:06 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-10-08 19:23 Microsoft Windows NT 10.0.26200.0
版本:1.45.5 2026-10-08 09:02 Microsoft Windows NT 10.0.19044.0
版本:1.45.5 2026-10-07 22:53 Microsoft Windows NT 10.0.26100.0
版本:1.45.5 2026-10-07 08:48 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-10-04 14:16 Microsoft Windows NT 10.0.19041.0
版本:1.45.5 2026-10-04 03:54 Microsoft Windows NT 10.0.26200.0
版本:1.45.5 2026-10-04 01:38 Microsoft Windows NT 10.0.26300.0
版本:1.45.5 2026-10-03 19:09 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-10-03 16:25 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-10-02 14:42 Microsoft Windows NT 10.0.26100.0
版本:1.45.5 2026-09-30 10:35 Microsoft Windows NT 10.0.19045.0
版本:1.45.5 2026-09-29 16:19 Microsoft Windows NT 10.0.19045.0
报错信息 2
InvalidOperationException: 在 Window 关闭时,无法将 Visibility 设置为 Visible,也无法调用 Show、ShowDialog、Close 或 WindowInteropHelper.EnsureHandle。
StackTrace:
   在 System.Windows.Window.VerifyNotClosing()
   在 System.Windows.Window.InternalClose(Boolean shutdown, Boolean ignoreCancel)
   在 __ScriptExecution.__hqvwezzd.PanelWindow.<.ctor>b__34_0(Object s, EventArgs e)
   在 System.Windows.Window.OnDeactivated(EventArgs e)
   在 System.Windows.Window.HandleActivate(Boolean windowActivated)
   在 System.Windows.Window.WmActivate(IntPtr wParam)
   在 System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

版本:1.45.5 2026-10-11 12:35 Microsoft Windows NT 10.0.19045.0