C# 地铁风格WinRT XAML应用程序中SemanticZoom中ZoomeOutView的奇怪定位

C# 地铁风格WinRT XAML应用程序中SemanticZoom中ZoomeOutView的奇怪定位,c#,xaml,microsoft-metro,windows-runtime,C#,Xaml,Microsoft Metro,Windows Runtime,我在ZommedInView和ZoomedOutView中使用了一个包含GridView的SemanticZoom。ZoomedOutView中的一个似乎没有捕捉到容器。容器是一个StackPanel,位于ScrollViewer中。这意味着当我缩小时,如果水平对齐设置为左,我的项目将在屏幕外。 另外,当我在设计器中选择zommed in gridview时,它会清楚地显示在预期的位置,填充scrollviewer。缩小的gridview显示为超出页面边界 交换放大和缩小视图的内容会将问题交换到

我在ZommedInView和ZoomedOutView中使用了一个包含GridView的SemanticZoom。ZoomedOutView中的一个似乎没有捕捉到容器。容器是一个StackPanel,位于ScrollViewer中。这意味着当我缩小时,如果水平对齐设置为左,我的项目将在屏幕外。 另外,当我在设计器中选择zommed in gridview时,它会清楚地显示在预期的位置,填充scrollviewer。缩小的gridview显示为超出页面边界

交换放大和缩小视图的内容会将问题交换到另一个gridview,因此我们可以推断问题与gridview没有区别

有没有办法修复它或者它是控件中的一个bug

<ScrollViewer
        x:Name="itemGridScrollViewer"
        AutomationProperties.AutomationId="ItemGridScrollViewer"
        Grid.Row="1"
        Margin="0,-3,0,0"
        Style="{StaticResource HorizontalScrollViewerStyle}">

        <!--
        ItemTemplateSelector="{StaticResource hubItemTemplateSelector}"
        ItemTemplate="{StaticResource Standard250x250ItemTemplate}"
        -->
        <StackPanel
                    Margin="116,0,40,46">
        <SemanticZoom ManipulationMode="RotateInertia">
            <SemanticZoom.ZoomedInView>
                    <GridView
                    AutomationProperties.AutomationId="ItemGridView"
                    AutomationProperties.Name="Grouped Items"
                    ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
                    ItemTemplateSelector="{StaticResource hubItemTemplateSelector}"
                    SelectionMode="None"
                    IsItemClickEnabled="True"
                    ItemClick="ItemView_ItemClick"
                    IsSwipeEnabled="True">

                        <GridView.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VirtualizingStackPanel Orientation="Horizontal"/>
                            </ItemsPanelTemplate>
                        </GridView.ItemsPanel>
                        <GridView.GroupStyle>
                            <GroupStyle>
                                <GroupStyle.HeaderTemplate>
                                    <DataTemplate>
                                        <Grid Margin="1,0,0,6">
                                            <Button
                                            AutomationProperties.Name="Group Title"
                                            Content="{Binding Path=Title}"
                                            Click="Header_Click"
                                            Style="{StaticResource TextButtonStyle}"/>
                                        </Grid>
                                    </DataTemplate>
                                </GroupStyle.HeaderTemplate>
                                <GroupStyle.Panel>
                                    <ItemsPanelTemplate>
                                        <VariableSizedWrapGrid MaximumRowsOrColumns="2" ItemHeight="250" ItemWidth="250" Orientation="Horizontal"/>
                                    </ItemsPanelTemplate>
                                </GroupStyle.Panel>
                            </GroupStyle>
                        </GridView.GroupStyle>
                    </GridView>
                </SemanticZoom.ZoomedInView>
            <SemanticZoom.ZoomedOutView>
                    <GridView
                        AutomationProperties.AutomationId="CategoryGridView"
                        AutomationProperties.Name="Grouped Items Zoomed Out"
                        ItemsSource="{Binding Path=ItemGroups}"
                    >

                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <Button
                                    AutomationProperties.Name="Group Title"
                                    Content="{Binding Title}"
                                    Click="Header_Click"
                                    Style="{StaticResource TextButtonStyle}"/>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                        <GridView.ItemsPanel>
                            <ItemsPanelTemplate>
                                <WrapGrid ItemWidth="250" ItemHeight="250" MaximumRowsOrColumns="2" VerticalChildrenAlignment="Center" />
                            </ItemsPanelTemplate>
                        </GridView.ItemsPanel>
                        <GridView.ItemContainerStyle>
                            <Style TargetType="GridViewItem">
                                <Setter Property="Margin" Value="4" />
                                <Setter Property="Padding" Value="10" />
                                <Setter Property="Background" Value="#FF25A1DB" />
                                <Setter Property="BorderThickness" Value="1" />
                            </Style>
                        </GridView.ItemContainerStyle>
                    </GridView>
                </SemanticZoom.ZoomedOutView>
        </SemanticZoom>
        </StackPanel>
    </ScrollViewer>

解决方案似乎是在包含语义空间的StackPanel上设置HorizontalAlignment属性。如果将其设置为左侧,则内容将适当对齐