![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest
Posts: n/a
| Getting Attribute from XmlElement in XAML All: I am using this simple XML file as a test: <students> <student fname="Adam" /> <student fname="Bob" /> </students> I have used an XmlDataProvider to bind these items to a ListBox's ListBoxItems. This mechanism causes the ListBox to hold XmlElements. Works fine. I'm trying to set up a binding so that when the user selects a ListBoxItem, the fname is displayed in a TextBox. If I make the name part of the inner text of the item, it works OK, e.g., <student>Charlie</student> The text can then be retrieved via: <TextBox Text="{Binding SelectedItem.InnerText, ElementName=MyStudentList}"></TextBox> The big question is -- Is it possible in XAML to get an atttribute of an XmlElement from the SelectedItem of a ListBox? What would the sytax be for the binding? Thanks, John |
|
|
| |