BlockUIContatiner中的ListView在分页时不会在Flow Document的页面中拆分

时间:2014-09-23 15:08:39

标签: c# wpf xaml pagination flowdocument

我正在使用blockuicontainer并在其中显示listview。 对文档进行分页时,列表视图不会在页面中拆分,而是移动到新页面。 我希望我的列表视图能够连续显示,并在大页面时将其拆分为页面。enter code here

<FlowDocumentReader x:Class="TMSSS.TRAPPER.Modules.MailMerge.Views.PdfCescheckView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:resources="clr-namespace:TMSSS.Trapper.Resources;assembly=TMSSS.Trapper.Resources"
             xmlns:viewModels="clr-namespace:TMSSS.TRAPPER.Modules.MailMerge.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <FlowDocumentReader.DataContext>
        <viewModels:PdfBundeswehrViewModel/>
    </FlowDocumentReader.DataContext>
    <FlowDocument  ColumnGap="0" ColumnWidth="999999">
        <FlowDocument.Resources>
            <Style TargetType="{x:Type GridViewColumnHeader}" x:Key="MyHeaderStyle">
                <Setter Property="Background" Value="#CFDDEE" />
            </Style>
            <Style TargetType="TableCell" >
                <Setter Property="BorderBrush" Value="Black" />
                <Setter Property="BorderThickness" Value="0.5"/>
                <Setter Property="Padding" Value="2" />
            </Style>
        </FlowDocument.Resources>
        <BlockUIContainer>
            <TextBlock Text="{x:Static resources:Resources.Finalreport}" HorizontalAlignment="Center" TextDecorations="Underline" FontWeight="Bold" FontFamily="Arial"></TextBlock>
        </BlockUIContainer>

        <BlockUIContainer>
            <TextBlock Text="{x:Static resources:Resources.OverViewCesCheck}" HorizontalAlignment="Left" TextDecorations="Underline" FontWeight="Bold" Margin="0,20,0,0" FontFamily="Arial"></TextBlock>
        </BlockUIContainer>
        <BlockUIContainer>
            <ListView ItemsSource="{Binding PartsData}" Width="705" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="0,15,0,0" HorizontalAlignment="Left" FontFamily="Arial">
                <ListView.ItemContainerStyle>
                    <Style TargetType="{x:Type ListViewItem}">
                        <Setter Property="BorderBrush" Value="LightGray"/>
                        <Setter Property="BorderThickness" Value="0,0,0,1" />
                        <Setter Property="Foreground" Value="Black" />
                    </Style>
                </ListView.ItemContainerStyle>
                <ListView.View>
                    <GridView ColumnHeaderContainerStyle="{StaticResource MyHeaderStyle}">
                        <GridViewColumn Header="{x:Static resources:Resources.No}" Width="30" DisplayMemberBinding="{Binding No}" />
                        <GridViewColumn Header="{x:Static resources:Resources.Name}" Width="130" DisplayMemberBinding="{Binding Name}" />
                        <GridViewColumn Header="{x:Static resources:Resources.Number}" Width="90" DisplayMemberBinding="{Binding Number}" />
                        <GridViewColumn Header="{x:Static resources:Resources.NSNWithoutColon}" Width="90" DisplayMemberBinding="{Binding Nsn}" />
                        <GridViewColumn Header="{x:Static resources:Resources.AQL}" Width="90" DisplayMemberBinding="{Binding Aql}" />
                        <GridViewColumn Header="{x:Static resources:Resources.OK}" Width="90" DisplayMemberBinding="{Binding Ok}" />
                        <GridViewColumn Header="{x:Static resources:Resources.Exchange}" Width="90" DisplayMemberBinding="{Binding Exchange}" />
                        <GridViewColumn Header="{x:Static resources:Resources.Deficient}" Width="90" DisplayMemberBinding="{Binding Deficient}" />
                    </GridView>
                </ListView.View>

            </ListView>
        </BlockUIContainer>

        <BlockUIContainer>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="350,0,0,0">
                <TextBlock Text="{x:Static resources:Resources.Totaldeficient}" FontFamily="Arial" TextDecorations="Underline"></TextBlock>
                <TextBlock Text="{Binding TotalDeficient}" FontFamily="Arial"></TextBlock>
            </StackPanel>
        </BlockUIContainer>

    </FlowDocument>
</FlowDocumentReader>

0 个答案:

没有答案