Search code examples
xamlwindows-phone-8.1gridtextblockmediaelement

Add text on MediaElement fullscreen


I'd like to add text on WindowsPhone 8.1 MediaElement fullscreen mode, but I cannot get it visible. Here is my code:

<Grid>
    <MediaElement Name="MyMedia" IsFullWindow="True" MarkerReached="MyMedia_MarkerReached"/>
    <TextBlock x:Name="MediaTitles" Text="Hello World" HorizontalAlignment="Left" Margin="55,240,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="99" Width="270" FontSize="48" />
</Grid>

Any ideas what I'm doing wrong?


Solution

  • The property IsFullWindow="True" is causing the problem. As you might know by now. If I want the media element full screen I usually add it to the grid and span across 1 for column and row. Something like below:

    <MediaElement 
        Grid.Row="0"
        Grid.Column="0"
        Grid.RowSpan="1"
        Grid.ColumnSpan="1" />
    

    This gives the same effect as full screen on the device. And you can see your Hello world text in the Designer.