Exception:当 ItemsSource 正在使用时操作无效。改用 ItemsControl.ItemsSource 访问和修改元素。

报错信息 1
InvalidOperationException: 当 ItemsSource 正在使用时操作无效。改用 ItemsControl.ItemsSource 访问和修改元素。
StackTrace:
   在 System.Windows.Controls.ItemCollection.CheckIsUsingInnerView()
   在 System.Windows.Controls.ItemCollection.Add(Object newItem)
   在 DynamicClass.cc.<>c__DisplayClass18f.<<初始化>b__176>d__2b4.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.23 2025-09-15 10:13 Microsoft Windows NT 10.0.22631.0