Advertisement

silverlight: in a dashboard widget

someone asked if would work in an ...interesting thought i felt.  after all, the dashboard widget concept is similar to the sidebar gadget feature in vista in that it is essentially a packaged file with html, javascript, images, etc.  so i went to task and tried it out.

i first started with a media player that i had been working on and it didn't go so well...more on that at a later time (startup javascripts, etc.).  after that i just dumbed it down to a simple sample that had some animation and stuff.

packaged it up, deploy to dashboard...and...

nothing.

hmm...what is going on here.  ah, yes, there is a setting in the dashboard widget that requires you to turn it on to allow internet plugins to work...modify to enable, redeploy.

nothing.  blech.  actually, not "nothing" but the default install prompt for silverlight -- which upon clicking did nothing.

with some pointers, i started realizing that the dashboard is likely not registering as "safari" or "firefox" or anything of the like.  it's built using , but perhaps that is the problem.  some others pointed me to that it is likely a conflict with the detection script in silverlight.js and not being able to figure something out.

so i changed to hard-code in the embed/object tag and then was able to get it working like this:

<div id="SilverlightControlHost" class="silverlightHost">

    <object type="application/ag-plugin" id="SilverlightControl" height="100%" width="100%">
        <param name="source" value="Scene.xaml">
        <param name="onError" value="default_error_handler">
        <param name="onLoad" value="javascript:_sl0">

    </object>
    
</div>

i wouldn't necessarily recommend using the object tag as the detection script works perfectly in typical browser situations (typical meaning != dashboards or other hosted models).  i'm going to take a look at the detection script next to see if hacking it up might make this work easier.

i can't figure out how to take a screenshot of a dashboard gadget working (capture doesn't work in the dashboard view), so you'll have to take my word for it.  if you want to try it out on your osx dashboard yourself, the test file is at the end of this post.  I also did a quick and dirty wrapper of lutz roeder's digger to see if it would work.  the keyboard interaction doesn't, but again i suspect that is some javascript hacking that needs to be modified in the engine script (of digger) to enable it working in webkit.

File: SLDash.zip
File: Digger.zip

  1. 12/23/2008 3:02 AM | # re: silverlight: in a dashboard widget
    Hi Tim,

    We are looking for Widget framework capability in Silverlight like in Telerik.
    demos.telerik.com/.../DefaultCS.aspx
    or
    http://www.codeplex.com/dropthings/

    Do you know of there any way to do this in solution or you fmilier with any componay control that implement widget framework for Silverlight?

    Thanks,

    Noam

 
Please add 6 and 4 and type the answer here:
First time here? You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting! (hide this)