为什么Flowdocument的工具提示没有显示?

时间:2011-09-22 01:39:35

标签: wpf flowdocument

我在FlowDocument中的工具提示有一个非常奇怪的问题。最后,我可以将其缩小到以下xaml。将以下xaml粘贴到kaxaml或Blend中,您将看到问题。

<FlowDocumentScrollViewer>
    <FlowDocument Background="Transparent">
        <Table>
            <Table.Columns>
                <TableColumn Width="15" />
                <TableColumn />
            </Table.Columns>
            <TableRowGroup>
                <TableRow>
                    <TableCell>
                        <Paragraph Margin="0,3.10333333333333,0,0">
                            <Run FontSize="5">●</Run>
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>
                            <Run FontSize="13"
                                 ToolTip="This is a tooltip">I have a tooltip</Run>
                        </Paragraph>
                        <Paragraph LineHeight="0.1"
                                   Background="Transparent">
                            <Figure Name="MyFigure"
                                    HorizontalAnchor="ColumnLeft"
                                    VerticalAnchor="ParagraphTop"
                                    CanDelayPlacement="False"
                                    Width="200"
                                    Padding="0,0,0,0">
                                <BlockUIContainer>
                                    <Grid>
                                        <Rectangle Name="MyRectangle"
                                                   Fill="Green"
                                                   Width="Auto"
                                                   Height="50" />
                                    </Grid>
                                </BlockUIContainer>
                            </Figure>
                        </Paragraph>
                    </TableCell>
                </TableRow>
            </TableRowGroup>
        </Table>
    </FlowDocument>
</FlowDocumentScrollViewer>

工具提示无法打开。但是,如果我执行以下操作之一,工具提示将显示。

  • 将MyFigure的宽度更改为15
  • 将MyRectangle的高度更改为5

它几乎感觉Run被某些东西覆盖,所以它的工具提示没有显示。

1 个答案:

答案 0 :(得分:3)

尝试在 FlowDocument 上设置IsDocumentEnabled="True"

编辑: IsDocumentEnabled属性位于RichTextBox上,在这种情况下无法帮助使工具提示工作。

相关问题