Monday, November 03, 2008 7:33 PM
chris.szurgot
Silverlight Gadget (version of snowflake app)
After posting my snowflake sample on Friday, I decided I wanted to make it a gadget since that was actually my intention with the WPF version, but WPF gadgets aren’t easy. However, putting a Silverlight in the sidebar is very easy (As long as you are not running 64-bit, which I am at home)
Simply copy the html page and the xap to a directory, and add a gadget.xml document with the basic info. Here’s the one I used.
<?xml version="1.0" encoding="utf-8"?>
<gadget>
<name>Snowflakes</name>
<namespace>
<!--_locComment_text="{Locked}"-->microsoft.windows
</namespace>
<version>
<!--_locComment_text="{Locked}"-->1.0.0.0
</version>
<author name="Chris Szurgot">
<info url="http://blogs.msdn.com/szurgot" text="Chris's Blog"/>
</author>
<description>Silverlight Snowflakes</description>
<icons>
<icon height="125" width="125" src="snowflakes.jpg"/>
</icons>
<hosts>
<host name="sidebar">
<base type="HTML" apiVersion="1.0.0" src="snowflakes.html"/>
<permissions>
<!--_locComment_text="{Locked}"-->Full
</permissions>
<platform minPlatformVersion="0.3"/>
<defaultImage src="Icon.jpg"/>
</host>
</hosts>
</gadget>
The only other important change is to the html file. Change the source of the silverlight object to includ x-gadget.
x-gadget:///snowflakes.xap
Add an icon image if uou want one (it will show up in the “Add Gadgets” screen) and zip up all of the files into a file called name.gadget.
I’ve put together a gadget install here.
I will admit it’s not much, but it paves the way for some of the other stuff I have planned.