private void ThemeParkPhotos_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error == null) { try { //No errors have been passed now need to take this file and parse it //Its in XML format XDocument xdox = XDocument.Parse(e.Result); //need a list for them to be put in to List<Photos> themeparkPhoto = new List<Photos>(); XNamespace ns = "http://schemas.datacontract.org/2004/07/WCFServiceWebRole1"; //Now need to get every element and add it to the list foreach (XElement item in xdox.Descendants(ns + "Photos")) { Photos content = new Photos(); content.ID = Convert.ToInt32(item.Element(ns + "ID").Value); content.PhotoURL = Convert.ToString(item.Element(ns + "PhotoURL").Value); //content.ID = Convert.ToInt32(item.Element(ns + "id").Value); //content.ThemeParkName = item.Element(ns + "name").Value.ToString(); themeparkPhoto.Add(content); } this.ThemeParkPhoto.ItemsSource = themeparkPhoto.ToList(); //Delete all the stuff } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { //There an Error } }