Search

NullReferenceException in System.Windows.Automation.Peers.GroupItemAutomationPeer.GetChildrenCore() by AChisholm

Closed
as Fixed Help for as Fixed

4
0
Sign in
to vote
Type: Bug
ID: 316681
Opened: 12/10/2007 3:29:16 PM
Access Restriction: Public
1
Workaround(s)
7
User(s) can reproduce this bug
On certain machines when running our WPF application it crashes with the following.

Exception:
Object reference not set to an instance of an object.

Stack Trace:
at System.Windows.Automation.Peers.GroupItemAutomationPeer.GetChildrenCore()
at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
at System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.ContextLayoutManager.fireAutomationEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

This occurs just after a Page is loaded inside a Frame element, the page has a Grouped ListView where the Group's are templated with a button and the sub-items are only displayed as a tooltip. Repeated issues on a particular machine suggest it is related to the application running at the same time as the Webex client application
(http://www.webex.com.au/au/support/downloads-webex.html).
Details (expand)
Product Language
English

Version

.NET Framework 3.0
Operating System
Windows Vista
Operating System Language
English
Steps to Reproduce
1. Create a WPF application with a Window with a <Frame> inside it.
2. Add page and set the frame source to that page.
3. Add a ListView with the following Xaml.
<ListView
x:Name="OrderList"
SelectionMode="Extended"
ItemsSource="{Binding}"
Margin="0,0,5,5"
>
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<VirtualizingStackPanel x:Name="GroupStackPanel" IsVirtualizing="True" />
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Button Margin="5,5,5,5" Click="GroupItem_Clicked" MinHeight="40">
<Button.ToolTip>
<Border MaxHeight="250" MaxWidth="400">
<ItemsPresenter />
</Border>
</Button.ToolTip>
<TextBlock FontWeight="DemiBold" Margin="5,5,5,5"><InlineUIContainer>
<TextBlock Text="{Binding Path=Name}" />
</InlineUIContainer><Run Text=" "/><Run Text=" ("/><Run Text=" "/><InlineUIContainer>
<TextBlock Text="{Binding Path=ItemCount}"/>
</InlineUIContainer><Run Text=" "/><Run Text=")" /></TextBlock>
</Button>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle>
</ListView>

4. Bind the Page to any data source.
5. Start the Webex client application
6. Run the WPF application

This should intermittently reproduce the issue (possibly a threading issue?).
Actual Results
Exception is thrown without a specific trigger by the application, and only on certain machine configurations.
Expected Results
Should either be able to catch the exception at a point where it can be handled cleanly, or not throw the exception. Additional details about the cause of the exception might also be useful.
TAP Code (if applicable)
 
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by DonovanH on 10/19/2011 at 5:19 PM
I can get this bug in my .NET 4.0 app 100% of the time when I navigate to a certain part of the app, as soon as any UI automation is enabled, e.g. using UISpy.
Posted by mirkoklemm on 9/15/2011 at 4:00 AM
I am Using .NET 4, but the issue persists for me.
Posted by Microsoft on 2/22/2008 at 10:55 AM
This issue has been fixed in the .Net 3.5 SP1 release
Posted by Microsoft on 12/11/2007 at 1:50 AM
Thanks for your feedback. We are escalating this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you,
Visual Studio Product Team
Sign in to post a workaround.
Posted by John Melville on 1/12/2008 at 11:32 PM
As mentioned in some of the confirmation messages, killing the TabTip process does, in fact, remedy this issue.