Parsing XML File in Windows Phone in No Time

Welcome all again.

Yesterday, I decided to make an application for recipes on the Windows Phone. I had a XML file and I had to parse it or extract data from it to complete my application. It was hard for me to type each recipe and then use it. So finally I decided to to parse the XML file. One of the most interesting features of Blend is that it creates sample data from a class or XML file. So I created a new project in Visual Studio and opened it in Blend. It took less then 5 minutes and I was able to see well-presented recipes in my application. You can also do it, let's discover it.

  • Open Blend and create a new project.

  • Go to the Data tab at the top-right.

    Data tab

  • Go to the Data tab and click on the Create Sample data tab.

  • Click on Create Sample Data from XML.

  • You will see a dialog like this:

    dialog

  • Browse the XML file that you want to parse and click OK.

  • Now at the right side in the Data tab you will see data and collection.

    data and collection in windows phone

  • Drag the collection and drop onto the Windows Phone interface.

  • Change the Item Template depending on your needs.

  • Your XML file is parsed.

  • By using this procedure you can parse any type of XML file.

  • This saves time and gives quick results.

    v cooking

I hope you enjoyed this article.

See you next time.

Happy Coding!
Personal Blog: Blend Unleashed.


Similar Articles