<UserControl x:Class="RichMediaAd.MediaControl"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Height="170" Width="220" Margin="0,0,0,0">

    <Grid x:Name="LayoutRoot" Background="White" Margin="0,0,0,0">

        <Canvas Width="220" Height="170" Background="White" x:Name="Player">

           <Canvas.Resources>

               <Storyboard x:Name="TopOverlayIn">

                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"

                           Storyboard.TargetName="TopOverlay"

                            Storyboard.TargetProperty="(Canvas.Left)">

                     <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>

                  </DoubleAnimationUsingKeyFrames>

               </Storyboard>

               <Storyboard x:Name="TopOverlayOut">

                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 

                           Storyboard.TargetName="TopOverlay" 

                           Storyboard.TargetProperty="(Canvas.Left)">

                     <SplineDoubleKeyFrame KeyTime="00:00:01" Value="-325"/>

                  </DoubleAnimationUsingKeyFrames>

               </Storyboard>

               <Storyboard x:Name="BottomOverlayIn">

                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"

                           Storyboard.TargetName="BottomOverlay"

                            Storyboard.TargetProperty="(Canvas.Left)">

                     <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>

                  </DoubleAnimationUsingKeyFrames>

               </Storyboard>

               <Storyboard x:Name="BottomOverlayOut">

                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"

                           Storyboard.TargetName="BottomOverlay"

                           Storyboard.TargetProperty="(Canvas.Left)">

                     <SplineDoubleKeyFrame KeyTime="00:00:01" Value="-325"/>

                  </DoubleAnimationUsingKeyFrames>

               </Storyboard>

           </Canvas.Resources>

             <MediaElement x:Name="MainMovieStream" Width="220" Height="170"

                            Canvas.Left="0" Canvas.Top="0" Stretch="Fill"

                            MarkerReached="MainMovieStream_MarkerReached"/>

             <Canvas Width="220" Height="39" Canvas.Left="-325" x:Name="TopOverlay" 

                      Canvas.Top="0">

                <Rectangle Opacity="0.4" x:Name="TopRect" Width="220" Height="39"

                            Fill="#FF808080" Stroke="#FF000000"/>

                 <TextBlock RenderTransformOrigin="0.496,0.176" x:Name="TopText" Width="215"

                            Height="27" FontSize="18" FontWeight="Bold"

                            Foreground="#FFFFFFFF" Text="http://www.google.com"

                            TextWrapping="Wrap" Canvas.Left="5" Canvas.Top="5" Cursor="Hand"

                            MouseLeftButtonDown="TopText_MouseLeftButtonDown"/>

             </Canvas>

             <Canvas Width="220" Height="39" Canvas.Left="-325" x:Name="BottomOverlay"

                     Canvas.Top="131">

                 <Rectangle Opacity="0.4" x:Name="BottomRect" Width="220" Height="39"

                             Fill="#FF808080" Stroke="#FF000000"/>

                 <TextBlock RenderTransformOrigin="0.496,0.176" x:Name="BottomText" 

                             Width="215" Height="27" FontSize="18"

                            FontWeight="Bold" Foreground="#FFFFFFFF" 

                            Text="My First Overlay"

                            TextWrapping="Wrap" Canvas.Left="5" Canvas.Top="6" Cursor="Hand"

                            MouseLeftButtonDown="BottomText_MouseLeftButtonDown"/>

             </Canvas>

         </Canvas>

     </Grid>

</UserControl >