Search Wiki:
Resource Page Description
An Ad Rotator control in Silverlight 2 that uses the AdRotator XML format This can use use ads in JPEG, PNG, WMV, or Xaml format. All standard ad formats are supported.


This is a Silverlight-based Ad Rotator that uses the same XML format as the AdRotator class. In addition to image formats you can also specify WMV and XAML ads.

What this Code Demonstrates

  • A custom control that can be skinned and styles
  • Design-time view and Expression Blend extensibility (Section & Property Description)
Ad Rotator in Expression Blend Ad Rotator in Expression Blend Properties Pane

Sample Usage

<UserControl x:Class="Silverlight_Test.Page"
    <Grid x:Name="LayoutRoot" Background="Azure">
            <TextBlock Text="Ad Rotator" Margin="5" HorizontalAlignment="Center" FontWeight="Bold"/>
                <ar:AdRotator Format="Button" Source="../Advertisements.xml"/>

Sample AdRotator XML

<?xml version="1.0" encoding="utf-8" ?>
<Advertisements xmlns="">
  <Ad xmlns="">
    <AlternateText>Ball Watch Company's Trainmaster Cannonball in Silverlight</AlternateText>
  <Ad xmlns="">
    <AlternateText>Bear Video</AlternateText>
  <Ad xmlns="">
    <AlternateText>Xaml Ad</AlternateText>
Last edited Feb 5 2009 at 4:23 AM  by mscherotter, version 3
Page view tracker