title: WP7 - Positioning AdControl
body: <p>Is there an easy way to position an AdControl inside of a Panorama? Right now, I can only get my AdControl to show if I set up my object tree like so:</p>
  
  <pre><code>Layout Root &gt; Panorama &gt; ...
              &gt; AdControl1
  </code></pre>
  
  <p>That is, with both my Panorama and my AdControl as immediate children of LayoutRoot.</p>
  
  <p>I only want to show my AdControl on the first PanoramaItem, but when I do this, it fail to render:</p>
  
  <pre><code>LayoutRoot &gt; Panorama &gt; PanoramaItem &gt; StackPanel &gt; ListBox
                                                    &gt; AdControl
  </code></pre>
  
  <p>That is, I want my AdControl to be underneath my ListBox, stuck to the bottom of that PanoramaItem only. What am I missing?</p>
  
  <p><strong>EDIT:</strong> The XAML, extra PanoramaItems omitted</p>
  
  <p><strong>Working</strong></p>
  
  <pre><code>&lt;!--LayoutRoot is the root grid where all page content is placed--&gt;
      &lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt;
  
          &lt;!--Panorama control--&gt;
          &lt;controls:Panorama Title="bad religion"&gt;
              &lt;controls:Panorama.Background&gt;
                  &lt;ImageBrush ImageSource="PanoramaBackground.png"/&gt;
              &lt;/controls:Panorama.Background&gt;
  
              &lt;!--Panorama item one--&gt;
              &lt;controls:PanoramaItem Header="content"&gt;
                  &lt;!--Double line list with text wrapping--&gt;
                  &lt;ListBox x:Name="LyricsListBox" Margin="0,0,-12,0" ItemsSource="{Binding Items}" SelectionChanged="LyricsListBox_SelectionChanged"&gt;
                      &lt;ListBox.ItemTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;StackPanel Margin="0,0,0,17" Width="432" Height="78"&gt;
                                  &lt;TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/&gt;
                                  &lt;TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/&gt;
                              &lt;/StackPanel&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/ListBox.ItemTemplate&gt;
                  &lt;/ListBox&gt;
              &lt;/controls:PanoramaItem&gt;
          &lt;/controls:Panorama&gt;
          &lt;my:AdControl AdUnitId="TextAd" ApplicationId="test_client" Height="80" HorizontalAlignment="Left" Margin="0,720,0,0" Name="adControl1" VerticalAlignment="Top" Width="480" /&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p><strong>Not Working</strong></p>
  
  <pre><code> &lt;!--LayoutRoot is the root grid where all page content is placed--&gt;
      &lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt;
  
          &lt;!--Panorama control--&gt;
          &lt;controls:Panorama Title="bad religion"&gt;
              &lt;controls:Panorama.Background&gt;
                  &lt;ImageBrush ImageSource="PanoramaBackground.png"/&gt;
              &lt;/controls:Panorama.Background&gt;
  
              &lt;!--Panorama item one--&gt;
              &lt;controls:PanoramaItem Header="content"&gt;
                  &lt;StackPanel&gt;
                      &lt;!--Double line list with text wrapping--&gt;
                      &lt;ListBox x:Name="LyricsListBox" Margin="0,0,-12,0" ItemsSource="{Binding Items}" SelectionChanged="LyricsListBox_SelectionChanged"&gt;
                          &lt;ListBox.ItemTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;StackPanel Margin="0,0,0,17" Width="432" Height="78"&gt;
                                      &lt;TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/&gt;
                                      &lt;TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/ListBox.ItemTemplate&gt;
                      &lt;/ListBox&gt;
                      &lt;my:AdControl AdUnitId="TextAd" ApplicationId="test_client" Height="80" HorizontalAlignment="Left" Margin="0,720,0,0" Name="adControl1" VerticalAlignment="Top" Width="480" /&gt;
                  &lt;/StackPanel&gt;
              &lt;/controls:PanoramaItem&gt;
          &lt;/controls:Panorama&gt;        
      &lt;/Grid&gt;
  </code></pre>