InvalidOperationException: 正在關閉視窗時,無法將 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)