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.