WPF崩溃不在我们的代码中

WPF崩溃不在我们的代码中,wpf,crash,Wpf,Crash,有人知道如何解决WPF中的崩溃问题吗?在WPF中,调用堆栈完全在windows代码中 下面是调用堆栈 2014年6月26日下午3:29:05:[致命]System.InvalidOperationException:指定的元素已经是另一个元素的逻辑子元素。先把它断开。 位于System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent) 位于System.Windows.FrameworkElement

有人知道如何解决WPF中的崩溃问题吗?在WPF中,调用堆栈完全在windows代码中

下面是调用堆栈

2014年6月26日下午3:29:05:[致命]System.InvalidOperationException:指定的元素已经是另一个元素的逻辑子元素。先把它断开。 位于System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent) 位于System.Windows.FrameworkElement.AddLogicalChild(对象子对象) 位于System.Windows.Controls.ContentControl.OnContentChanged(对象oldContent,对象newContent) 位于System.Windows.Controls.TabItem.OnContentChanged(对象oldContent,对象newContent) 位于System.Windows.Controls.ContentControl.OnContentChanged(DependencyObject d,DependencyPropertyChangedEventArgs e) 位于System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 位于System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 位于System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs参数) 在System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex EntryIndex,DependencyProperty dp,PropertyMetadata,EffectiveValueEntry oldEntry,EffectiveValueEntry&newEntry,布尔强制WithDeferredReference,布尔强制WithCurrentValue,OperationType OperationType) 位于System.Windows.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject fo,DependencyProperty dp) 在System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject容器、FrugalStructList
1和ExclutionContainerDependents、FrugalStructList
1和oldContainerDependents、FrugalStructList`1和newContainerDependents) 位于System.Windows.StyleHelper.DoStyleInvalizations(FrameworkElement fe、FrameworkContentElement fce、Style oldStyle、Style newStyle) 在System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe、FrameworkContentElement fce、Style oldStyle、Style newStyle、Style&styleCache) 在System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d,DependencyPropertyChangedEventArgs e) 位于System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 位于System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 位于System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs参数) 在System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex EntryIndex,DependencyProperty dp,PropertyMetadata,EffectiveValueEntry oldEntry,EffectiveValueEntry&newEntry,布尔强制WithDeferredReference,布尔强制WithCurrentValue,OperationType OperationType) 位于System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp、对象值、PropertyMetadata元数据、布尔强制WithDeferredReference、布尔强制WithCurrentValue、OperationType OperationType、布尔isInternal) 位于System.Windows.Controls.ItemsControl.ApplyItemContainerStyle(DependencyObject容器,对象项) 位于System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject容器,对象项) 位于System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainerGenerator(DependencyObject容器) 在System.Windows.Controls.Panel.GenerateChildren()中 位于System.Windows.Controls.Panel.OnItemChangedInternal(对象发送器,ItemsChangedEventArgs参数) 在System.Windows.Controls.Panel.OnItemChanged(对象发送器,ItemsChangedEventArgs args) 在System.Windows.Controls.ItemContainerGenerator.OnRefresh()中 位于System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(对象发送者,NotifyCollectionChangedEventArgs) 位于System.Windows.Controls.ItemContainerGenerator.System.Windows.IWeakEventListener.ReceiveWeakEvent(类型managerType,对象发送方,事件参数e) 位于System.Windows.EventManager.DeliverEventToList(对象发送者、事件参数、监听器列表) 位于System.Windows.EventManager.DeliverEvent(对象发送者,事件参数) 位于System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(对象发送者,NotifyCollectionChangedEventArgs) 位于System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(对象发送方,NotifyCollectionChangedEventArgs e) 位于System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs) 位于System.Windows.Controls.ItemCollection.SetCollectionView(CollectionView视图) 位于System.Windows.Controls.ItemCollection.SetItemsSource(IEnumerable值) 在System.Windows.Controls.ItemsControl.OnItemsSourceChanged(DependencyObject d,DependencyPropertyChangedEventArgs e) 位于System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 位于System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 位于System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs参数) 在System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex EntryIndex,DependencyProperty dp,PropertyMetadata,EffectiveValueEntry oldEntry,EffectiveValueEntry&newEntry,布尔强制WithDeferredReference,布尔强制WithCurrentValue,OperationType OperationType) 位于System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp) 位于System.Windows.Data.BindingExpressionBase.Invalidate(布尔值IsSubpertyChange) 位于System.Windows.Data.BindingExpression.TransferValue(对象newValue,布尔值IsSubpertyChange) 位于System.Windows.Data.BindingExpression.Activate(对象项) 位于System.Windows.Data.BindingExpression.AttachToContext(AttachAttmpt尝试) 在System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachT