设计窗口不显示

时间:2015-08-30 12:31:35

标签: c# xaml windows-store-apps

我正在使用C#和XAML制作Windows应用商店

我正在制作媒体播放器应用程序,但我遇到了几个问题: - 设计表单没有显示我的组件(我清理了解决方案,我重新构建了解决方案,我构建了解决方案,重新启动了VS,但它仍然没有显示任何内容)。

enter image description here

  • 然后我的其他组件之一,滑块也不会在运行时显示。

我对此很新,所以任何帮助都将受到赞赏。

<Page
x:Class="MediaPlayer_LU08_Formative.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MediaPlayer_LU08_Formative"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <AppBar x:Name="TransportControlsPanel" Height="198" Width="1346"      VerticalAlignment="Bottom" Visibility="Visible" IsSticky="True" IsOpen="True" HorizontalAlignment="Center" Margin="10,0,10,10">
        <AppBar.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black" />
                <GradientStop Color="#FFA86E6E" Offset="1"/>
            </LinearGradientBrush>
        </AppBar.Background>
        <StackPanel Width="900" VerticalAlignment="Bottom">
            <AppBarButton x:Name="Open" Click="Open_Click_1" HorizontalAlignment="Center" Icon="OpenLocal" />
            <Slider x:Name="Vol_Slider" Height="15" Width="112" Value="100" Background="White" FlowDirection="LeftToRight"  Maximum="100" Minimum="0" Visibility="Visible" Margin="394,0"/>
            <StackPanel Orientation="Horizontal" Height="84" Margin="0,0,-15,0">
                <AppBarButton x:Name="btnPlay" Click="btnPlay_Click" Icon="Play" />
                <AppBarButton x:Name="btnPause" Click="btnPause_Click" Icon="Pause"/>
                <AppBarButton x:Name="btnStop" Click="btnStop_Click" Icon="Stop" AutomationProperties.Name="Stop"/>
                <AppBarButton x:Name="btnReverse" Click="btnReverse_Click" Icon="Previous"/>
                <AppBarButton x:Name="btnForward" Click="btnForward_Click" Icon="Next"/>
                <AppBarButton x:Name="btnMute" Click="btnMute_Click" Icon="Mute" AutomationProperties.Name="Mute"/>
                <AppBarButton x:Name="btnFullScreenMode" Click="btnFullScreenMode_Click" Icon="FullScreen" AutomationProperties.Name="Full Screen"/>
                <AppBarButton x:Name="DecreaseVolume" Click="DecreaseVolume_Click" Icon="Volume" AutomationProperties.Name="Volume" Content="++"/>
                <AppBarButton x:Name="IncreaseVolume" Click="IncreaseVolume_Click" Icon="Volume" AutomationProperties.Name="Volume" Content="--"/>
            </StackPanel>
        </StackPanel>
    </AppBar>
    <ContentControl x:Name="videoContainer" KeyUp="videoContainer_KeyUp" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Height="700" VerticalAlignment="Top" Margin="10,0">
        <MediaElement x:Name="VideoPlayer" AutoPlay="False" Volume="100"/>
    </ContentControl>
</Grid>

1 个答案:

答案 0 :(得分:-1)

如果存在,则必须添加 AppBar AppBarButton 的命名空间。