Sign in TopomorphRSS Feed
  • Create the solution
  • Add a post build action utility project
  • Add the Silverlight projects to the web project
  • Create the settings  of the gadget

1 Create the solution

If you have installed the templates I wrote about in a previous post, you can find a new solution template here:

image

If you run this template you end up with a solution with several projects.

    

Silverlight gadget solution

As you can see the template created 5 Silverlight projects, each for a different part of the gadget. It also created a web project. This is the actual project where all the Silverlight application come together.

2 Add Post build utility project

Also, as I posted before, I have added an empty utility project to package the generated files into a zip with extension “.gadget”. That would be a nice addition to the template. For now the post build project hast to be added by hand.
Here you’ll find a zip with both the batch file and the list file:

The batch file and the listfile ZipGadget.zip

The post build action itself:

cd "$(SolutionDir)$(SolutionName)\SilverlightSidebarGadgetWeb\" 
ZipGadget.bat 

By now you might be tempted to build your project and install the generated gadget (I know I did). But there’s two more things to do before you get a valid gadget.

3 Add the Silverlight to the web project:

The template has no means to add the Silverlight projects to the web project so You’ll have to add them yourself. Go to the property page of the web project and add each of the projects

image

image

Make sure the Destination folder is the same you specified in the post build project, and check the Enable Silverlight debugging checkbox.

4 Create the settings for your gadget.

In the web project you’ll find the file gadget.xml in which the settings of your gadget are defined. The important parts are marked by square brackets. Change these to indentify your gadget, and be sure to think about the name of the gadget file. Vista uses both the filename and gadget.xml to show information about your gadget.

Now you can build and add your Silverlight Gadget to your toolbar. Hello docked!

And now you’re ready for the real stuff: Silverlight. I’ll show you about continuous animation in a next post.

Comments