InvalidOperationException: 无法在 CollectionChanged 事件过程中更改 ObservableCollection。 StackTrace: 在 System.Collections.ObjectModel.ObservableCollection`1.CheckReentrancy() 在 System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index) 在 System.Collections.ObjectModel.Collection`1.Remove(T item) 在 DynamicClass.cc.<>c__DisplayClass1bc.<初始化>b__fb(Object s, 分组列表内的按钮变化通知Args e) 在 DynamicClass.主模型.On某个分组的按钮列表内容Changed(Object sender, NotifyCollectionChangedEventArgs e) 在 DynamicClass.分组头.On按钮列表内容Changed(NotifyCollectionChangedEventArgs e) 在 System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) 在 System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) 在 System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index) 在 System.Collections.ObjectModel.Collection`1.Remove(T item) 在 DynamicClass.cc.<>c__DisplayClass1bc.<>c__DisplayClass1e8.<初始化>b__142(Object obj) 在 MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated) 在 System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg) 在 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)