@רחמים
זה לא מספיק צריך עוד...
במיוחד תסתכל ב stack trace
innerException
וגם ב message
תעתיק לפה את הטקסט שלהם ולא תמונה.
stack trace =
ב- System.Windows.Controls.ItemContainerGenerator.Verify()
ב- System.Windows.Controls.VirtualizingStackPanel.MeasureChild(IItemContainerGenerator& generator, IContainItemStorage& itemStorageProvider, IContainItemStorage& parentItemStorageProvider, Object& parentItem, Boolean& hasUniformOrAverageContainerSizeBeenSet, Double& computedUniformOrAverageContainerSize, Boolean& computedAreContainersUniformlySized, IList& items, Object& item, IList& children, Int32& childIndex, Boolean& visualOrderChanged, Boolean& isHorizontal, Size& childConstraint, Rect& viewport, VirtualizationCacheLength& cacheSize, VirtualizationCacheLengthUnit& cacheUnit, Boolean& foundFirstItemInViewport, Double& firstItemInViewportOffset, Size& stackPixelSize, Size& stackPixelSizeInViewport, Size& stackPixelSizeInCacheBeforeViewport, Size& stackPixelSizeInCacheAfterViewport, Size& stackLogicalSize, Size& stackLogicalSizeInViewport, Size& stackLogicalSizeInCacheBeforeViewport, Size& stackLogicalSizeInCacheAfterViewport, Boolean& mustDisableVirtualization, Boolean isBeforeFirstItem, Boolean isAfterFirstItem, Boolean isAfterLastItem, Boolean skipActualMeasure, Boolean skipGeneration, Boolean& hasBringIntoViewContainerBeenMeasured, Boolean& hasVirtualizingChildren)
ב- System.Windows.Controls.VirtualizingStackPanel.MeasureOverrideImpl(Size constraint, Nullable1& lastPageSafeOffset, List
1& previouslyMeasuredOffsets, Nullable`1& lastPagePixelSize, Boolean remeasure)
ב- System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)
ב- System.Windows.Controls.Primitives.DataGridRowsPresenter.MeasureOverride(Size constraint)
ב- System.Windows.FrameworkElement.MeasureCore(Size availableSize)
ב- System.Windows.UIElement.Measure(Size availableSize)
ב- System.Windows.ContextLayoutManager.UpdateLayout()
ב- System.Windows.UIElement.UpdateLayout()
ב- System.Windows.Controls.TabItem.OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
ב- System.Windows.UIElement.OnPreviewGotKeyboardFocusThunk(Object sender, KeyboardFocusChangedEventArgs e)
ב- System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
ב- System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
ב- System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
ב- System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
ב- System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
ב- System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
ב- System.Windows.Input.InputManager.ProcessStagingArea()
ב- System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
ב- System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
ב- System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
ב- System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
ב- System.Windows.UIElement.Focus()
ב- System.Windows.Controls.TabItem.SetFocus()
ב- System.Windows.Controls.TabItem.OnMouseLeftButtonDown(MouseButtonEventArgs e)
ב- System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
ב- System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
ב- System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
ב- System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
ב- System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
ב- System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
ב- System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
ב- System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
ב- System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
ב- System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
ב- System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
ב- System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
ב- System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
ב- System.Windows.Input.InputManager.ProcessStagingArea()
ב- System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
ב- System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
ב- System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
ב- System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
ב- System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
ב- MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
ב- MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
ב- 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)
ב- System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
ב- MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
ב- MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
ב- System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
ב- System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
ב- System.Windows.Application.RunDispatcher(Object ignore)
ב- System.Windows.Application.RunInternal(Window window)
ב- System.Windows.Application.Run(Window window)
ב- System.Windows.Application.Run()
ב- AppDonorNew.App.Main() ב- C:\Users\Latitude E7240\Documents\Visual Studio 2015\Projects\AppDonorNew\AppDonorNew\obj\Debug\App.g.cs:שורה 0
ב- System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
ב- System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
ב- Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
ב- System.Threading.ThreadHelper.ThreadStart_Context(Object state)
ב- System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
ב- System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
ב- System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
ב- System.Threading.ThreadHelper.ThreadStart()
innerException =
{"Information for developers (use Text Visualizer to read this):\r\nThis exception was thrown because the generator for control 'System.Windows.Controls.DataGrid Items.Count:8' with name '(unnamed)' has received sequence of CollectionChanged events that do not agree with the current state of the Items collection. The following differences were detected:\r\n Accumulated count 7 is different from actual count 8. [Accumulated count is (Count at last Reset + #Adds - #Removes since last Reset).]\r\n\r\nOne or more of the following sources may have raised the wrong events:\r\n System.Windows.Controls.ItemContainerGenerator\r\n System.Windows.Controls.ItemCollection\r\n System.Windows.Data.ListCollectionView\r\n System.Collections.Generic.List`1[[Person.Donation, Person, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]\r\n(The starred sources are considered more likely to be the cause of the problem.)\r\n\r\nThe most common causes are (a) changing the collection or its Count without raising a corresponding event, and (b) raising an event with an incorrect index or item parameter.\r\n\r\nThe exception's stack trace describes how the inconsistencies were detected, not how they occurred. To get a more timely exception, set the attached property 'PresentationTraceSources.TraceLevel' on the generator to value 'High' and rerun the scenario. One way to do this is to run a command similar to the following:\n System.Diagnostics.PresentationTraceSources.SetTraceLevel(myItemsControl.ItemContainerGenerator, System.Diagnostics.PresentationTraceLevel.High)\r\nfrom the Immediate window. This causes the detection logic to run after every CollectionChanged event, so it will slow down the application.\r\n"}
message =
An ItemsControl is inconsistent with its items source.
See the inner exception for more information.
תודה רבה!
פורסם במקור בפורום CODE613 ב17/08/2015 22:40 (+03:00)