![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Simple class with self-referencing member fail to run: StackOverflowException | .NET General | |||