Wpf 滚动查看属性';内容';设置多次

Wpf 滚动查看属性';内容';设置多次,wpf,xaml,microsoft-metro,Wpf,Xaml,Microsoft Metro,这是我的代码: <Grid Style="{StaticResource LayoutRootStyle}"> <Grid.RowDefinitions> <RowDefinition Height="140"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <ScrollViewer Gr

这是我的代码:

<Grid Style="{StaticResource LayoutRootStyle}">
    <Grid.RowDefinitions>
        <RowDefinition Height="140"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <ScrollViewer 
            Grid.RowSpan="2" Style="{StaticResource HorizontalScrollViewerStyle}"
            HorizontalScrollBarVisibility="Visible" >
            <!-- The elements you want to be horizontally scrollable goes here -->
            <!-- Horizontal scrolling grid used in most view states -->

        <GridView
            Name="itemGridView"
            AutomationProperties.AutomationId="ItemsGridView"
            AutomationProperties.Name="Items"
            TabIndex="1"
            Padding="100,136,116,46"
            ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
            ItemTemplate="{StaticResource Standard250x250ItemTemplate}"
            SelectionMode="None"
            IsSwipeEnabled="false"
            IsItemClickEnabled="True"
            ItemClick="ItemView_ItemClick"/>

         <Button Hello />  <!-- From here come the Error -->           
    </ScrollViewer>
</Grid>


当我在我的
GridView
之后添加任何东西时,它会给我这个错误(属性
content
设置了多次)。

答案就在错误消息中。一个
ScrollViewer
只能有一个子项(您有两个子项,一个
GridView
和一个
按钮
)。如果要添加多个内容,必须将它们包装在允许多个子项的面板中(例如,
Grid