Почему мой FlowDocument не использует всю ширину? - PullRequest
3 голосов
/ 14 ноября 2011

Я конвертирую HTML в XAML и загружаю его в StackPanel с помощью FlowDocumentScrollViewer. Контент корректно отображается из 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%

Что я пропускаю? Заранее спасибо!

1 Ответ

0 голосов
/ 15 ноября 2011

Я нашел проблему. У меня был просмотрщик документов с панелью стека в моем xaml, поэтому он не воспроизводился правильно. Я удалил это, и это решило проблему.

...