如何控制 FlowDocument 缩放控件的高度

发布于 2024-07-21 13:16:55 字数 704 浏览 10 评论 0原文

在下文中,缩放控件最终与 Expander 控件中设置的 FontSize 成比例:

<ScrollViewer>
  <StackPanel>
    <Expander MaxHeight="500" Margin="5" Padding="5" FontSize="40pt" Header="Test Header">
      <FlowDocumentReader ViewingMode="Scroll" >
        <FlowDocument  Foreground="Black" FontSize="18pt">
          <List>
              <ListItem>
                <Paragraph>Test</Paragraph>
              </ListItem>
            </List>
        </FlowDocument>
      </FlowDocumentReader>
    </Expander>
  </StackPanel>
</ScrollViewer>

我希望能够独立于 Expander 控件中的设置来控制缩放控件的高度。

关于我如何做到这一点有什么想法吗?

In the following, the zoom controls end up being proportional to the FontSize set in the Expander control:

<ScrollViewer>
  <StackPanel>
    <Expander MaxHeight="500" Margin="5" Padding="5" FontSize="40pt" Header="Test Header">
      <FlowDocumentReader ViewingMode="Scroll" >
        <FlowDocument  Foreground="Black" FontSize="18pt">
          <List>
              <ListItem>
                <Paragraph>Test</Paragraph>
              </ListItem>
            </List>
        </FlowDocument>
      </FlowDocumentReader>
    </Expander>
  </StackPanel>
</ScrollViewer>

I would like to be able to control the height of the zoom controls independent of settings in the Expander control.

Any ideas on how I can do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

裸钻 2024-07-28 13:16:55

想出了一种方法来做到这一点。 设置 FlowDocumentReader 的 FontSize。 那么缩放按钮的大小将取决于 FlowDocumentReader 中的 FontSize。

可能不是理想的方法,但它确实有效。

Figured out one way to do it. Set the FontSize of the FlowDocumentReader. Then the size of the zoom buttons will depend on the FontSize in the FlowDocumentReader.

Probably not the ideal way to do it, but it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文