viewing xml data in wpf [modified]
-
I just want to get the text in elements like the id, name, and lastactive from an xml file like this ( http://www.dreamincode.net/forums/xml.php?showuser=34 ) into a textbox or anything that would just display in a simple way, but I haven't been able to find anything that explains that level of it. How can I do this? -- Modified Sunday, August 22, 2010 3:07 AM
-
I just want to get the text in elements like the id, name, and lastactive from an xml file like this ( http://www.dreamincode.net/forums/xml.php?showuser=34 ) into a textbox or anything that would just display in a simple way, but I haven't been able to find anything that explains that level of it. How can I do this? -- Modified Sunday, August 22, 2010 3:07 AM
I demonstrate how to bind to XML data in this[^] article. All you need to do is replace the
XmlDataProvider
with a link to your data."WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
I demonstrate how to bind to XML data in this[^] article. All you need to do is replace the
XmlDataProvider
with a link to your data."WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Never mind, figured it out. Thank you very much, your article and method was the first -after hours trying to get this to work- that made much sense to me. -- Modified Sunday, August 22, 2010 5:39 AM
Sonar87 wrote:
figured it ou
Excellent.:thumbsup:
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Sonar87 wrote:
figured it ou
Excellent.:thumbsup:
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
Is there any way I can get the resource/xml file I'm reading from to be changed, say, based on user input when the program is running, or does it have to stay a set path that I decide ahead of time? I tried accessing some of the info back in the Window1.xaml.cs file to to see if I could make changes there but if theres a way its nothing I've thought of.
-
Is there any way I can get the resource/xml file I'm reading from to be changed, say, based on user input when the program is running, or does it have to stay a set path that I decide ahead of time? I tried accessing some of the info back in the Window1.xaml.cs file to to see if I could make changes there but if theres a way its nothing I've thought of.
You can change it just by changing the DataContext. As long as you've implemented your binding, your UI elements should change when the context does.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.