C# 在xaml UWP中将CommandBar添加到当前歌曲列表的顶部。财产';内容';设置多次

C# 在xaml UWP中将CommandBar添加到当前歌曲列表的顶部。财产';内容';设置多次,c#,windows,xaml,user-interface,uwp,C#,Windows,Xaml,User Interface,Uwp,我试图将两部分xaml代码合并在一起,它们都是独立工作的,但当结合在一起时,我无法让它工作。什么是正确的方法。我已将命令栏xmal放在 “获取内容错误”错误消息在哪里?请把它贴出来。当我写感谢时,@John Wiese,请编辑你原来的帖子并添加到那里。我试着把它放在其他地方,但我得到了同样的错误,或者什么也没有显示。我应该把命令栏放在页面顶部的什么位置?代码XLS0501不用担心,没关系。审查问题的人也会查看评论。“获取内容错误”错误消息在哪里?请把它贴出来。当我写感谢时,@Joh

我试图将两部分xaml代码合并在一起,它们都是独立工作的,但当结合在一起时,我无法让它工作。什么是正确的方法。我已将命令栏xmal放在




“获取内容错误”错误消息在哪里?请把它贴出来。当我写感谢时,@John Wiese,请编辑你原来的帖子并添加到那里。我试着把它放在其他地方,但我得到了同样的错误,或者什么也没有显示。我应该把命令栏放在页面顶部的什么位置?代码XLS0501不用担心,没关系。审查问题的人也会查看评论。“获取内容错误”错误消息在哪里?请把它贴出来。当我写感谢时,@John Wiese,请编辑你原来的帖子并添加到那里。我试着把它放在其他地方,但我得到了同样的错误,或者什么也没有显示。我应该把命令栏放在页面顶部的什么位置?代码XLS0501不用担心,没关系。审查问题的人也会检查评论。
<CommandBar Margin="-10,46,10,0" IsOpen="True" Name="xCommand"  >
    <AppBarToggleButton x:Name="apbartg1" IsChecked="False" Icon="Mute" Label="Mute"  Click="AppBarMuteButton_Click" />
    <AppBarToggleButton Icon="RepeatAll" Label="Refresh" Click="AppBarRefreshButton_Click"/>
    <AppBarSeparator/>
    <AppBarButton Icon="Stop" Label="Stop" Click="AppBarStopButton_Click"/>
    <AppBarButton Icon="Play" Label="Play" Click="AppBarPlayButton_Click"/>

    <!--<CommandBar.SecondaryCommands>
        <AppBarButton Icon="Like" Label="Like" Click="AppBarButton_Click"/>
        <AppBarButton Icon="Dislike" Label="Dislike" Click="AppBarButton_Click"/>
    </CommandBar.SecondaryCommands>-->

    <CommandBar.Content>
        <TextBlock x:Name="contentNameText" Text="Now playing..." Margin="12,8"/>
    </CommandBar.Content>
</CommandBar>
<Page
    x:Class="mInc.WUP.Audio.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:mInc.WUP.Audio"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:models="using:mInc.WUP.Audio.Models"
    mc:Ignorable="d">



    
    <Page.Resources>
       
        <x:String x:Key="ChevronGlyph">&#xE26B;</x:String>

        <CollectionViewSource
            x:Name="GroupedMusicListSource"
            Source="{x:Bind MainModel.GroupedMusicList}"
            IsSourceGrouped="True"
            ItemsPath="Items"
            />

        <CollectionViewSource
            x:Name="UngroupedMusicListSource"
            Source="{x:Bind MainModel.UngroupedMusicList}"
            IsSourceGrouped="False"
            />
    </Page.Resources>
    <GridView ItemsSource="{Binding Source={StaticResource GroupedMusicListSource}}"
              SelectionMode="None"
              Name="GuestGridView"
              IsItemClickEnabled="True"
              ItemClick="GuestGridView_ItemClick"
              >

        <GridView.GroupStyle >
            <GroupStyle>
                <GroupStyle.HeaderTemplate >
                    <DataTemplate x:DataType="models:SongGroupModel" >
                        <Grid Margin="0,0,0,2" >
                            <Button
                                Foreground="{ThemeResource ApplicationHeaderForegroundThemeBrush}"
                                IsEnabled="{x:Bind HasGroupDetails}"
                                Click="Header_Click"
                                Style="{StaticResource TextBlockButtonStyle}" >
                                <RelativePanel >
                                    <TextBlock
                                        Name="TitleBlock"
                                        RelativePanel.AlignLeftWithPanel="True"
                                        RelativePanel.AlignVerticalCenterWithPanel="True"
                                        Text="{x:Bind Title}" Margin="0,0,10,0"
                                        Style="{StaticResource TitleTextBlockStyle}" />
                                    <TextBlock
                                        RelativePanel.RightOf="TitleBlock"
                                        RelativePanel.AlignVerticalCenterWithPanel="True"
                                        Text="{StaticResource ChevronGlyph}"
                                        FontFamily="Segoe MDL2 Assets"
                                        FontWeight="Normal"
                                        Style="{StaticResource TitleTextBlockStyle}" />
                                </RelativePanel>
                            </Button>
                        </Grid>
                    </DataTemplate>
                </GroupStyle.HeaderTemplate>
            </GroupStyle>
        </GridView.GroupStyle>

        <GridView.ItemTemplate>
            <DataTemplate x:DataType="models:SongModel" >
                <StackPanel
                    Orientation="Horizontal"
                    HorizontalAlignment="Center"
                    Width="300"
                    BorderThickness="1" BorderBrush="DarkBlue"
                    Background="AliceBlue"
                    >
                    <StackPanel HorizontalAlignment="Center" Padding="5" >
                        <StackPanel Orientation="Horizontal" >
                            <TextBlock Text="Title:" FontWeight="Bold" />
                            <TextBlock Name="AlbumBlock" Margin="5,0,0,0"
                               Text="{x:Bind Title}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" >
                            <TextBlock Text="Album:" FontWeight="Bold" />
                            <TextBlock Name="ArtistBlock" Margin="5,0,0,0"
                               Text="{x:Bind Album}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" >
                            <TextBlock Text="Artist:" FontWeight="Bold" />
                            <TextBlock Name="TitleBlock" Margin="5,0,0,0"
                               Text="{x:Bind Artist}" />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </DataTemplate>
        </GridView.ItemTemplate>
        
    </GridView>
</Page>
<!--<CommandBar.SecondaryCommands>
    <AppBarButton Icon="Like" Label="Like" Click="AppBarButton_Click"/>
    <AppBarButton Icon="Dislike" Label="Dislike" Click="AppBarButton_Click"/>
</CommandBar.SecondaryCommands>-->

<CommandBar.Content>
    <TextBlock x:Name="contentNameText" Text="Now playing..." Margin="12,8"/>
</CommandBar.Content>