gpt4 book ai didi

c# - 为什么我的 FlowDocument 不使用整个宽度?

转载 作者:行者123 更新时间:2023-11-30 18:40:30 24 4
gpt4 key购买 nike

我正在将 HTML 转换为 XAML,并使用 FlowDocumentScrollViewer 将其加载到 StackPanel 中。内容从 HTML 正确呈现。我的问题是内容或 FlowDocument 似乎没有使用整个宽度。

html 到 xaml 的转换看起来像这样

<FlowDocument xml:space="preserve" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Paragraph>Central Contractor Registration Is Free It Shouldn't Cost You A Dime </Paragraph>
<Paragraph>Central Contractor Registration is free. The federal government does not charge a fee to register your business in the central contractor registration database. I am telling you that central contractor registration is free because there is some confusion out there and I want to [...] </Paragraph>
</FlowDocument>

Dim conversionhtml As String = "<FlowDocument xml:space=""preserve"" xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""><Paragraph>Central Contractor Registration Is Free It Shouldn't Cost You A Dime </Paragraph><Paragraph>Central Contractor Registration is free. The federal government does not charge a fee to register your business in the central contractor registration database. I am telling you that central contractor registration is free because there is some confusion out there and I want to [...]</Paragraph></FlowDocument>"
Dim fd As FlowDocument = DirectCast(Markup.XamlReader.Parse(conversionhtml), FlowDocument)
Dim fdr As New FlowDocumentScrollViewer()
fdr.Document = fd
FeedsDisplay.Children.Add(fdr)

feedsdisplay 是一个普通的堆栈面板。问题是 flowdocumentscrollviewer 使用了整个宽度,但看起来流文档只使用了大约 40%

我忽略了什么?提前致谢!

最佳答案

我发现了问题。我的 xaml 中有一个带有堆栈面板的 documentscrollviewer,所以它没有正确重新生成。我删除了这个并解决了问题。

关于c# - 为什么我的 FlowDocument 不使用整个宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8126803/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com