A Silverlight 2 Ad Rotator

I’ve been learning how to build Silverlight 2 Custom Controls and wanted to share my first one.  Since I work with a number of creative agencies, I thought that an Ad Rotator would be relevant; this one can rotate ads that are images, video, or XAML.

I’ve also worked hard to make it easy for designers to use.  To do this, I’ve created a design-time graphic that shows up only in Expression Blend and added Category and Description attributes to the control properties.

If you want to use the AdRotator in a Silverlight application, here’s what you do:

  1. Download the source code from the MSDN Code Gallery.
  2. In Expression Blend or Visual Studio add a reference to the AdRotatorLibrary\Bin\Release\AdRotatorLibrary.dll
  3. From the Assets panel Custom Controls Tab in Expression Blend, drag a AdRotator onto your page
  4. Create an Advertisement XML file using the ASP.net Ad rotator format.
  5. Select the AdRotator control and pick the Format and Source in the Ad Properties

Tell me what you think.

Design-Time graphic
Design-time view

Ad Category and Format Description
Ad Category Attribute and Format Description Attribute