1

I have access to an XML array of the following format:

<Title>Blah</Title>
<Status>Blah</Status>
<Info>
    <Item>Blah blah blah</Item>
    <Item>Blah blah blah</Item>
    ....
</Info>

My MainWindow sets its DataContext to my MainWindowViewModel which contains an object ObservableResults. This class is ObservableResults : ObservableCollection<ViewableResult> and creates a ViewableResult object. It also sets this object's member data, Title, Status, and Info by parsing the XML string above. I can already bind to this object and display Title, Status, and Info as plain text, but need to parse the Info node into an additional member of ViewableResult or perhaps replace the Info member. This would be some kind of object with which I can manipulate each separate Item node in the XAML, hopefully to create some kind of custom display format other than just plain text.

Edit: Apparently it's unclear what the question is. I'm trying to find a good method of parsing the Info node into an object that can individually access Item nodes.

3
  • 1
    You forgot to ask your question. Please do so now. Commented Oct 2, 2012 at 13:30
  • Can you provide the code for the ViewableResult object? Commented Oct 2, 2012 at 13:33
  • @DanielHilgarth I thought it was fairly clear that I was looking for a method of parsing the Info node into some kind of object I can manipulate on the Item level in my XAML. I'll rephrase the question. Commented Oct 2, 2012 at 13:36

1 Answer 1

1

A good start to solve your problem should be to use Serialization, it's really handy when you need to save Objects into an XML file and load them back for whatever you want.

You should make your objects as serializable then add some methods like Load(), Save(), etc.

Read this for more informations : MSDN - Serialization

You'll find plenty informations on how to do this !

Hope it will help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.