1

I'm getting this error:

Error:The 'Grid' start tag on line 17 position 6 does not match the end tag of 'phone:PhoneApplicationPage'.

I have tried many things to solve this error, but have failed. Please tell me how to solve this.

My code is:

<phone:PhoneApplicationPage
x:Class="wmvplayer.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">

<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>


<!--TitlePanel contains the name of the application and page title-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        <TextBlock Text="WMV Player" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>
    <StackPanel Background="Black">

        <!-- To interactively stop, pause, and play the media, the LoadedBehavior 
       property of the MediaElement must be set to "Manual". -->
        <MediaElement Source="media\numbers.wmv" Name="myMediaElement" 
 Width="450" Height="250" Stretch="Fill" 
 MediaOpened="Element_MediaOpened" MediaEnded="Element_MediaEnded"/>

        <StackPanel HorizontalAlignment="Center" Width="450" Orientation="Horizontal">

            <Image Source="play.png" MouseEnter="OnMouseDownPlayMedia" Margin="5" />

            <!-- Pause button. -->
            <Image Source="pause.png" MouseEnter="OnMouseDownPauseMedia" Margin="5" />

            <!-- Stop button. -->
            <Image Source="stop.png" MouseLeave="OnMouseDownStopMedia" Margin="5" />

            <!-- Volume slider. This slider allows a Volume range between 0 and 1. -->
            <TextBlock Foreground="White" VerticalAlignment="Center" Margin="5"  >Volume</TextBlock>
            <Slider Name="volumeSlider" VerticalAlignment="Center" ValueChanged="ChangeMediaVolume" 
   Minimum="0" Maximum="1" Value="0.5" Width="70"/>

            <!-- Volume slider. This slider allows you to change the speed of the media playback. -->
            <TextBlock Foreground="White" Margin="5"  VerticalAlignment="Center">Speed</TextBlock>
            <Slider Name="speedRatioSlider" VerticalAlignment="Center" ValueChanged="ChangeMediaSpeedRatio" 
   Value="1" Width="70" />

            <!-- Seek to slider. Ths slider allows you to jump to different parts of the media playback. -->
            <TextBlock Foreground="White" Margin="5"  VerticalAlignment="Center">Seek To</TextBlock>
            <Slider Name="timelineSlider" Margin="5" ValueChanged="SeekToMediaPosition" Width="70"/>

        </StackPanel>
    </StackPanel>
    </Grid> </phone:PhoneApplicationPage>
4

1 回答 1

1

我将您的代码添加到我的测试应用程序中,没有发现此类错误。只需尝试正确对齐标签并重建您的应用程序。

于 2013-08-17T06:28:23.743 回答