Good Morning! All is well in Wisconsin as the Bears were destroyed by the Green Bay Packers yesterday AND the Minnesota Vikings lost as well. It just does not get better than that.
The topic today is reading an XML file using LINQ for a Silverlight application I am working on. Make it a great day!
Private Sub startXml()
Dim client As New WebClient()
AddHandler client.OpenReadCompleted, AddressOf finishXml
client.OpenReadAsync(New Uri("Resources/wlsl-manifest.xml", UriKind.Relative))
Private Sub finishXml(ByVal sender As Object, ByVal e As OpenReadCompletedEventArgs)
‘ Create a new StreamReader instance using the specified Stream object.
Using streamreader As New StreamReader(e.Result)
Dim manifest As XDocument = XDocument.Load(streamreader)
Dim slides As IEnumerable(Of XElement) = manifest.Element("Slides").Elements("Slide")
For Each slide As XElement In slides
Dim assembly As String = slide.Element("Assembly").Value