如何将StackPanel拉伸到FullScreen

时间:2013-07-04 09:43:19

标签: c# xaml windows-runtime

我有使用FlipView的ItemDetailPage.xaml,在DataTemplate里面我有Grid with come列。其中一列包含带有一些控件的StackPanel 例如:

<FlipView.ItemTemplate>
    <DataTemplate>
        <UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates">
            <ScrollViewer x:Name="scrollViewer" Style="{StaticResource HorizontalScrollViewerStyle}" Grid.Row="1">
                <Grid Margin="120,0,20,20" x:Name="richTextColumns">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="250" />
                        <ColumnDefinition Width="30" />
                        <ColumnDefinition Width="400" />
                        <ColumnDefinition Width="30" />
                        <ColumnDefinition Width="400" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>

                    <StackPanel Orientation="Vertical" Grid.Column="2" Grid.Row="1" Margin="0,0,0,10" x:Name="ContentPanel">
                        <TextBlock FontSize="22" FontWeight="Light" Text="{Binding Title}" TextWrapping="Wrap" />
                        <Image x:Name="image" Width="200" Margin="0,10,0,10" Stretch="UniformToFill" Source="{Binding Image}"/>


                            <StackPanel Orientation="Horizontal" Margin="0,0,0,5">
                                <RichTextBlock x:Name="InformationOriginalName" Width="250" 
                                           Style="{StaticResource ItemRichTextStyle}" IsTextSelectionEnabled="False">
                                    <Paragraph>
                                        <Run FontWeight="SemiLight" Text="{Binding EvaInformation.OriginalName}"/>
                                    </Paragraph>
                                </RichTextBlock>
                            </StackPanel>
                    </StackPanel>

                    ....

                </Grid>
            </ScrollViewer>
        </UserControl>
    </DataTemplate>
</FlipView.ItemTemplate>

如何将 ContentPanel 拉伸到FullScreen并隐藏所有不同的控件,包括后退按钮和页面标题?

0 个答案:

没有答案