0

StackPanelとScrollViewerは、Grid.Rowの位置で終わっていないようです。私はMetroアプリを作成しているので、グリッドとすべての要素が動的であることが必須です。

コード:

<Grid Background="#FFE4E4E4">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.5*"/>
            <ColumnDefinition Width="0.5*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="0.5*"/>
            <RowDefinition Height="0.5*"/>
        </Grid.RowDefinitions>

        <!--News/Leaderboard Feed-->
        <StackPanel Grid.Column="0" Grid.Row="0">

        </StackPanel>

        <!--Marketplace Feed-->
        <StackPanel Grid.Column="0" Grid.Row="1">

        </StackPanel>

        <!--Detailed Marketplace Account-->
        <StackPanel Grid.Column="1" Grid.Row="1">

        </StackPanel>


        <!--Marketplace View-->
        <StackPanel Grid.Column="1" Grid.Row="0" VerticalAlignment="Top">
            <ScrollViewer VerticalAlignment="Top">
                <!--Allows scrolling-->

                <GridView x:Name="MarketplaceFeed" ItemsSource="{Binding StockList}" ItemTemplate="{StaticResource MarketplaceFeedTemplate}" VerticalAlignment="Top">
                    <!--Displays the stock markets the user is interested in.-->
                    <GridView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapGrid Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </GridView.ItemsPanel>
                </GridView>


            </ScrollViewer>
        </StackPanel>

    </Grid>
4

1 に答える 1

1

ScrollViewerを外側に配置する必要があります。これはグリッドに自動調整され、その中のすべてがスクロール処理されます。

   <!--Marketplace View-->
    <ScrollViewer VerticalAlignment="Top" Grid.Column="1" Grid.Row="0">
        <StackPanel VerticalAlignment="Top">
            <!-- other content -->
        </StackPanel>
    </ScrollViewer>
于 2012-08-20T21:40:43.650 に答える