I'm basically trying to create the following set of code dynamically/programmatically but I'm unsure of how to do it.

```
    <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition/>
    </Grid.RowDefinitions>

    <smf:SMFPlayer x:Name="player" Grid.Row="0" AutoPlay="False">
        <smf:SMFPlayer.Playlist>
            <media:PlaylistItem 
                DeliveryMethod="AdaptiveStreaming" 
                MediaSource="http://video3.smoothhd.com.edgesuite.net/ondemand/Big%20Buck%20Bunny%20Adaptive.ism/Manifest"/>
            <media:PlaylistItem 
                DeliveryMethod="AdaptiveStreaming" 
                SelectedCaptionStreamName="textstream_eng"
                MediaSource="http://streams.smooth.vertigo.com/elephantsdream/Elephants_Dream_1024-h264-st-aac.ism/manifest"/>
        </smf:SMFPlayer.Playlist>
    </smf:SMFPlayer>

    <StackPanel Grid.Row="1" Orientation="Horizontal" Background="Transparent">
        <Button x:Name="test1" Height="30" Width="70" Content="Test 1"/>
        <Button x:Name="test2" Height="30" Width="70" Content="Test 2"/>
    </StackPanel>
</Grid>

```

Here's how it looks statically:

![](https://i.imgur.com/uz1O8.png)