【问题标题】:Design window not displaying设计窗口不显示
【发布时间】:2015-08-30 12:31:35
【问题描述】:

我正在使用 C# 和 XAML 制作一个 Windows 商店应用程序

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

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

我对此很陌生,因此我们将不胜感激。

<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>

【问题讨论】:

    标签: c# xaml windows-store-apps


    【解决方案1】:

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

    【讨论】:

    • 我让设计器开始工作,但滑块在运行时仍然不显示,设计?我的代码有什么问题?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-07
    • 2020-11-24
    • 2011-11-10
    • 2011-09-15
    相关资源
    最近更新 更多