Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Calling an XPath on a Binding with an XmlNode causes StackOverflowException

 
 
Old 01-05-2007   #1 (permalink)
Keith Patrick


 
 

Calling an XPath on a Binding with an XmlNode causes StackOverflowException

I've been getting a hell of a lot more StackOverflows deep inside the
framework (WindowsBase.Utility.LargeSortedObjectMap.GetKeyValuePair) than
I'd really rather see, and I've finally hit upon the core scenario that's
causing it. Basically, I have a UI that passes around a bunch of XmlNodes as
the datasource. If one combo containing XML has an item selected, that item
(which is an XmlNode) is now the datasource for another control, etc. I hit
the problem at the very end of this chain where I try to do this:
<UserControl x:Class="BindingTest"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<TextBlock Name="Blah" Text="{Binding XPath=@Name}"/>
</StackPanel>
</UserControl>

And if I look at this user control during debugging, its DataContext is an
XmlNode with the OuterXml:
<Test Name=\"Why is this not showing up?\"></Test>

My question is: what's invalid about this? The data context is what it
should be (the control really is supposed to be displaying data contained
within that node). I've even tried setting the RelativeSource to
TemplatedParent, but that doesn't even work.



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Simple class with self-referencing member fail to run: StackOverflowException .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46