void MainPage_Loaded(object sender, RoutedEventArgs e) { WebClient webClient = new WebClient(); webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted); Uri xmlUri = new Uri(HtmlPage.Document.DocumentUri, "GetTrailersXml.ashx"); webClient.DownloadStringAsync(xmlUri); } void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error != null) { MessageBox.Show("There was an error retrieving xml"); return; } XDocument xDoc = XDocument.Parse(e.Result); foreach (XElement xMovieInfo in xDoc.Descendants("movieinfo")) { try { MovieTrailer trailer = new MovieTrailer(xMovieInfo); trailers.Add(trailer); } catch { } } AssignItems(); loadingControl.Visibility = Visibility.Collapsed; slider.Focus(); }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.