1
votes

Is there a way to dock a Windows Phone control to the bottom of a StackPanel? This is my basic layout:

<StackPanel Orientation="Vertical">
  <TextBlock />
  <TextBlock />
  <UI:AdControl />
</StackPanel>

My StackPanel is filling up the whole window. The TextBlocks are aligned toward the top of the panel, that's what I want.

But I want the AdControl to dock at the bottom of the StackPanel (and therefore the bottom of the window).

I've found controls like DockPanel, but they seem to only work for WPF or Silverlight as far as I can tell.

1

1 Answers

3
votes

This can easily be accomplished with a simple grid

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    <Grid.RowDefinitions>
    <StackPanel>
        <TextBlock />
        <TextBlock />
    </StackPanel>
    <UI:AdControl Grid.Row="1"/>
</Grid>

If you want exactly DockPanel for future use, make sure you look into open source implementations, there should be plenty of those out there!