I'm trying to create a Silverlight line chart from an XMLRPC data source (coming from Drupal), what steps do I need to take? Is there a step by step tutorial anywhere开发者_C百科 on how to do this?
If you want to call over HTTP and load some XML then you'd want to take a look at a class like WebClient. There's a video I made on using WebClient over here channel9.msdn.com/posts/mtaulty/Silverlight-4-Beta-Networking-Part-1-WebClient-and-XML/ which might help with that.
That will let you load your XML over the network. You'd then want to turn that into some objects because Silverlight doesn't really bind to XML. So, you'd use an API like LINQ to XML in order to turn it into objects. I think I walk through a simple example of LINQ to XML in that video but you might also try this video www.silverlight.net/learn/videos/all/readingwriting-xml-with-linq-to-xml/ as another example.
Once you've got your data into some collection of objects you need to bind those to the chart that you're using. In terms of how the chart binds to data you can find examples in the Silverlight Toolkit itself ( up at silverlight.codeplex.com ) or there's a sample page www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html that has examples of how to bind those items.
Hope that helps,
Mike.
thanks for that. Unfortunately most of that went way over my head, but I did manage to create the line chart and get it populated with data from Drupal using Visifire. It took care of all the Silverlight bits and let me interact with it using standards I'm more familiar with (XML, JS).
精彩评论