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

报错信息 1
InvalidOperationException: 指定的元素已经是另一个元素的逻辑子元素。请先将其断开连接。
StackTrace:
   在 System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
   在 System.Windows.FrameworkElement.AddLogicalChild(Object child)
   在 System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)
   在 DynamicClass.DynamicWPF.<>c__DisplayClass6.<SetControlBackgroundFromUrl>b__5()
   在 System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   在 System.Windows.Threading.Dispatcher.Invoke(Action callback)
   在 DynamicClass.DynamicWPF.<SetControlBackgroundFromUrl>d__8.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 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.5 2025-05-04 00:17 Microsoft Windows NT 10.0.26100.0