Cover

Silverlight SeeqPod Player now Silverlight 2 (with SourceCode)

March 23, 2008
No Comments.

Url: http://wildermuth.com/silverlightseeqpod
Silverlight SeeqPod Screen Shot
In my weekend attempt to upgrade some of my older examples, the Silverlight SeeqPod Player is now all Silverlight 2.

Converting the Silverligth 1.1 application to a 2.0 was remarkably harder than the Silverlight 1.0 to 2.0.  It may be because of use of user controls versus real controls (I changed from using two nested user controls to using a ListBox with Control Templates). In addition, switching the format of the web service usage from consuming XML directly to using DataContracts confused it a bit but overall it wasn’t difficult. Lastly, I was using a layered HTML input control for a TextBox, and changing it over to a built-in one, took a little time too. Some code just simply disappeared (as I was moving some text around to make it appear like it was centered, but now its just a matter of marking it as TextAlignment = Center.

I was also able to polish some features I wanted to add:

  • The Play Panel how slides in and out like I originally wanted.
  • When the URL from SeeqPod is a dead link, I now change the UI to show its a bad song so you don’t continue to click on the song.
  • I also added Tooltips to help make sense of some of the non-text buttons.

Here’s the source if you want to play with it: Source Code

UPDATE: I’ve updated the code (and the app) as I found some odd behavior with random or shuffle play.  One of the things I noticed was that the selected item was not getting updated all the time.  I realized that during some operations (MediaElement specific events and callbacks in Web Service Proxy’s), you’re not actually running on the main UI thread.  This is not a big surprise but since it fails silently it can cause odd issues.  To get around it I used the Dispatcher to fire an event on the UI thread:

Dispatcher.BeginInvoke(() => { songList.SelectedIndex = someValue; } );

You could use an anonymous delegate, but I prefer this shorthand Lambda function.  It fixed the issue with the wierdness of showing hte selected index.

Hope this helps some of you struggling with issues.