We have created a dynamic Xml file that contains both image and video files. I was wondering if this is possible to insert within the Coverflow control. Following your sample code for Coveflow Data Binding, I am not sure how to pass our Xml file instead of the Flicker web service you are using in your example.
Can you show me a sample or guide me on how to bind my
http://silverlight.techmediaconsultant.com/sqlxml/xmltemplate/getMedia.xml?top=100 for Image Source in code behind. We are working with VB 2010 but if video and images can't go together we will split them apart but still need your help binding our Xml.
Public Sub New()
InitializeComponent()
Dim webClient As New WebClient()
AddHandler webClient.DownloadStringCompleted, AddressOf Me.OnDownloadStringCompleted
webClient.DownloadStringAsync(
New Uri("http://silverlight.techmediaconsultant.com/sqlxml/xmltemplate/getMedia.xml?top=100", UriKind.Absolute))
End Sub
<--HERE BELOW IS WHERE WE CANNOT FIGURE OUT HOW TO PASS OUR XML-->
Private Sub OnDownloadStringCompleted(ByVal sender As Object, ByVal e As DownloadStringCompletedEventArgs)
Dim ImagesCollection 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", "http://www.w3.org/2005/Atom"))
Dim links As String() = (From link In entry.Elements(XName.[Get]("link", "http://www.w3.org/2005/Atom")) _
Where String.Compare(link.Attribute(XName.[Get]("rel")).Value, "enclosure") = 0 _
Select link.Attribute(XName.[Get]("href")).Value).ToArray()
If links.Length > 0 Then
ImagesCollection.Add(New Uri(links(0), UriKind.Absolute))
End If
Next
Me.coverflow.ItemsSource = ImagesCollection
End Sub
End
Class
Hernan.