WPF程序诡异错误,提示:无法在正在进行内容生成时调用StartAt

Cryking 2018-04-18 05:10:01
一个POS程序,在大多数情况下都正常,只是偶尔出现这个错误,但是一旦出现,就只能重装操作系统才能解决
错误堆栈如下:
鍦?System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.StartAt(GeneratorPosition position, GeneratorDirection direction, Boolean allowStartAtRealizedItem)
鍦?System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)
鍦?Microsoft.Windows.Controls.Primitives.DataGridRowsPresenter.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
鍦?System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
鍦?System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
鍦?System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
鍦?System.Windows.Controls.Grid.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Border.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Control.MeasureOverride(Size constraint)
鍦?Microsoft.Windows.Controls.DataGrid.MeasureOverride(Size availableSize)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
鍦?System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
鍦?System.Windows.Controls.Grid.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
鍦?System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Border.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Control.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
鍦?System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
鍦?System.Windows.Controls.Grid.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Border.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
鍦?System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
鍦?System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Controls.Border.MeasureOverride(Size constraint)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.Window.MeasureOverrideHelper(Size constraint)
鍦?System.Windows.Window.MeasureOverride(Size availableSize)
鍦?System.Windows.FrameworkElement.MeasureCore(Size availableSize)
鍦?System.Windows.UIElement.Measure(Size availableSize)
鍦?System.Windows.ContextLayoutManager.UpdateLayout()
鍦?System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
鍦?System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
鍦?System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
鍦?System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
鍦?System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
鍦?System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
鍦?System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

猜测是UI元素的生成和某控件发生冲突导致, 界面有定时器来刷新界面时间,用了观察者设计模式,求大神
...全文
1323 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Cryking 2020-04-09
  • 打赏
  • 举报
回复
目前发现卸载或禁止WPS相关服务可避免此问题
qq14923349 2018-05-30
  • 打赏
  • 举报
回复
资源和绑定顺序有误吧?
exception92 2018-04-26
  • 打赏
  • 举报
回复
只是偶尔出现这个错误 -》这说不上来。 提示的错误很明显了,应该在生成内容的操作完毕之后调用StartAt

8,735

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧