Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
748 views
in Technique[技术] by (71.8m points)

xaml - How to set the original width of a WPF FlowDocument

I have this XAML structure:

<wft:Dialog x:Class="WFT.PumpSvc.Bench.Parts.PartsPullListDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wft="http://schemas.Weatherford.com">
    <wft:Dialog.Resources>
        <ResourceDictionary Source="../Resources.xaml" />
    </wft:Dialog.Resources>
    <wft:CaptionedBox Style="{StaticResource HeaderCaptionedBox}" Name="captionedBox"  Caption="Parts Pull List">
        <DockPanel>
            <DockPanel DockPanel.Dock="Right">
                <StackPanel Orientation="Vertical" DockPanel.Dock="Top">
                    <wft:TouchButton Name="closeButton">Cancel</wft:TouchButton>
                </StackPanel>
                <StackPanel Orientation="Vertical" VerticalAlignment="Bottom">
                    <wft:TouchButton Name="printButton">Print</wft:TouchButton>
                </StackPanel>
            </DockPanel>

            <wft:CaptionedBox Caption="Preview">
                <FlowDocumentPageViewer Name="documentReader">
                    <FlowDocument Background="White">
                        <Paragraph FontSize="20" FontWeight="Bold">Parts Pull List</Paragraph>
                        <Table FontWeight="Bold">
                            <Table.Columns>
                                <TableColumn Width="*" />
                                <TableColumn Width="2*" />
                            </Table.Columns>
                            <TableRowGroup>
                                <TableRow>
                                    <TableCell>...
                                    <TableCell>...
                                </TableRow>
                                <TableRow>...
                                <TableRow>...
                            </TableRowGroup>
                        </Table>
                        <Table>
                            <Table.Columns>
                                <TableColumn Width="1*" />
                                <TableColumn Width="1*" />
                                <TableColumn Width="1*" />
                                <TableColumn Width="1*" />
                                <TableColumn Width="1*" />
                                <TableColumn Width="1*" />
                                <TableColumn Width="1*" />
                            </Table.Columns>
                            <TableRowGroup Name="partRowGroup">
                                <TableRow>
                                    <TableCell>
                                        <Paragraph>
                                            <Underline>SubAssembly Type</Underline>
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell>...
                                    <TableCell>...
                                    <TableCell>...
                                    <TableCell>...
                                    <TableCell>...
                                    <TableCell>...
                                </TableRow>
                            </TableRowGroup>
                        </Table>
                    </FlowDocument>
                </FlowDocumentPageViewer>
            </wft:CaptionedBox>
        </DockPanel>
    </wft:CaptionedBox>
</wft:Dialog>

As you see, I don't have any width settings on my page. However, my Tables only occupy half the horizontal space in the FlowDocument. What controls this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Set the FlowDocument ColumnWidth="999999"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...