Please explain code below

1 posts, 0 answers
  1. Hernan
    Hernan avatar
    4 posts
    Member since:
    Nov 2010

    Posted 28 Dec 2010 Link to this post

    Again trying to add my Xml file containing videos and images to my coverflow control and came accross to this code below, got some previous help but still cannot figure out how to add my logic in there. Test works ok with the Flicker web service but not with mine ( If anyone can try this on your end and get it right please post feedback.

    Private Sub OnDownloadStringCompleted(sender As Object, e As DownloadStringCompletedEventArgs)
       Dim flickerImagesCollection As New ObservableCollection(Of Uri)()

       Dim feed As XDocument = XDocument.Parse(e.Result)

       For Each entry As XElement In feed.Root.Elements(XName.[Get]("entry", ""))
        Dim links As String() = (From link In entry.Elements(XName.[Get]("link", "")) _
         Where String.Compare(link.Attribute(XName.[Get]("rel")).Value, "enclosure") = 0 _
         Select link.Attribute(XName.[Get]("href")).Value).ToArray()
        If links.Length > 0 Then
         flickerImagesCollection.Add(New Uri(links(0), UriKind.Absolute))
        End If

       Me.coverFlow.ItemsSource = flickerImagesCollection
      End Sub

Back to Top