Binding to an XElement
Posted
by
twreid
on Stack Overflow
See other posts from Stack Overflow
or by twreid
Published on 2012-07-12T18:16:22Z
Indexed on
2012/09/20
9:38 UTC
Read the original article
Hit count: 162
wpf
I need help binding to an XElement. Basically I am making a editor for certain elements in a web.config and I extract them as XElements and my View binds to a Collection of DataItems which has a property that contains my XElement.
When I do Text="{Binding Path=Data, Mode=OneWay, NotifyOnSourceUpdated=True}"/>
I get all the text of the Element, but If I try Text="{Binding Path=Data.Elements[], Mode=OneWay, NotifyOnSourceUpdated=True}"/>
It doesn't work the TextBox is empty. I am trying to find a way to Template different sections dynamically to make them easier to edit instead of editing raw XMl.
© Stack Overflow or respective owner