Every so often, users report this error. It is from Infragistics.WPF4.Controls.Menus.XamDataTree 14.2. It looks like there is an internal error happening in the XamDataTree, but I (so Far) haven't been able to reproduce it. What does this stack trace mean? Every time i run the offending process, it works fine.
System.NullReferenceException: Object reference not set to an instance of an object.
at Infragistics.Controls.Menus.IntermediateNodesManager.get_DataCount()
at Infragistics.Controls.Menus.NodesManager.Infragistics.IProvideDataItems<Infragistics.Controls.Menus.XamDataTreeNode>.get_DataCount()
at Infragistics.Collections.BindableItemCollection`1.GetCount()
at Infragistics.Collections.CollectionBaseEnumerator`1.System.Collections.IEnumerator.MoveNext()
at Infragistics.AutomationPeers.XamDataTreeNodeAutomationPeer.GetChildrenCore()
at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)
at System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
at Infragistics.AutomationPeers.XamDataTreeNodeAutomationPeer.Node_PropertyChanged(Object sender, PropertyChangedEventArgs e)
at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
at Infragistics.DependencyObjectNotifier.OnPropertyChanged(String propertyName)
at Infragistics.Controls.Menus.XamDataTreeNode.OnElementReleased(XamDataTreeNodeControl element)
at Infragistics.DependencyObjectRecyclingContainer`1.Infragistics.ISupportRecycling.OnElementReleased(FrameworkElement elem)
at Infragistics.RecyclingManager.PanelInfo.ReleaseElement(ISupportRecycling obj)
at Infragistics.Controls.Menus.Primitives.NodesPanel.ReleaseNode(XamDataTreeNode node, Boolean removeManager)
at Infragistics.Controls.Menus.Primitives.NodesPanel.ResetNodes(Boolean releaseAll)
at Infragistics.Controls.Menus.XamDataTree.XamDataTree_Unloaded(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastUnloadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Just saw that you provided a sample. I'm testing it now. Will let you know shortly if I can reproduce it.
so Windows 7 Professional Service Pack 1. like i said, though, i uploaded a sample that will illustrate the issue for you
I'm using .NET 4.5 and have all service packs etc applied to Win 7.
Thanks Rob. I was finally able to create a sample that reproduces the problem (when Narrator is running and works fine when Narrator is OFF). It doesn't make a lot sense, but it shows the issue. On close, the collection that is bound to the XamDataTree was being cleared inside a dispatcher. I still don't understand why this always worked fine before. OR why running Microsoft Narrator causes it to throw the null exsception. However, commenting out the clearing of the collection solved the error from occurring. This still leaves the question of why Narrator causes a problem in the XamDataTree control. I believe this may be a bug and should be addressed. I have uploaded the project so you may confirm the issue. Let me know your findings and if there is a resolution. Thanks again for your continued assistance.
Hi Travis,
I want to collect some environment information. This is what I know so far, is it correct:
OS: Windows 7 (SP1?)Infragistics 14.2.20142.2024Narrator program is open.NET: ?
What service pack for Win7 are you on? And also what version of .NET is your application using and what versions do you have installed? You can find out which versions are installed here: http://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx