I am trying to figure out how to make apps, i got all the basics and even more but what i want to no is how to create an app that you have a search bar and when you search it sends a requests a xml file from a server, the server send back the xml file and i display it. i look all over on how to do this but i couldn't find any tutorials. can anyone help?
More Detail:
I want to create a very basic app which accesses an XML fil开发者_如何学Ce at a web address and displays the various items within the file as text within the app. I've come across several tutorials which all seem to do it in a different way, or aren't explaining exactly the thing it is I want to do. I don't want to search the XML file, I don't want to update it, I just want to retrieve it's contents. Within the XML file are "items" and within those are categories like "title" and "description". I want the app to list all of the items and within each one display it's title and description.
How you download the xml will depend how the server you're interacting with serves the documents. Assuming it is a RESTful service, you can download a document from a specific URL using HttpWebRequest.
This sample project will show you how to use HttpWebRequest.
WebClient, HttpWebRequest and the UI Thread on Windows Phone 7
The stream object created in the ResponseCallback method can be passed instead to XDocument.Load to read the supplied XML data using LINQ.
This sample project will show you how do that and bind the retrieved data to a listbox for display.
binding a Linq datasource to a listbox
精彩评论