Exception:指定的元素已经是另一个元素的逻辑子元素。请先将其断开连接。

报错信息 1
InvalidOperationException: 指定的元素已经是另一个元素的逻辑子元素。请先将其断开连接。
StackTrace:
   在 System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
   在 System.Windows.FrameworkElement.AddLogicalChild(Object child)
   在 System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)
   在 DynamicClass.MainWindow.创建迷你窗口()
   在 DynamicClass.MainWindow.切换迷你模式()
   在 DynamicClass.MainWindow.<.ctor>b__1c(Object s, EventArgs e)
   在 System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   在 System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   在 System.Windows.Window.OnContentRendered(EventArgs e)
   在 System.Windows.Window.<PostContentRendered>b__204_0(Object unused)
   在 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.44.55 2026-04-15 19:49 Microsoft Windows NT 10.0.28000.0