Reputation: 1321
I have been using a RichTextBox
to show FlowDocuments
in a WPF app, but I found that there is something called FlowDocumentReader
which gives me alot of functionality for free. The problem is that while the background in the RichTextBox was shown as white, it is now completely transparent.
I have tried setting the Background
property, but that only changes the toolbar at the bottom.
<FlowDocumentReader Grid.Row="1" Grid.Column="1" Name="rtbShowDoc" Margin="20, 0" Background="White">
<FlowDocumentReader.Effect>
<DropShadowEffect BlurRadius="10" Color="Black" ShadowDepth="3" />
</FlowDocumentReader.Effect>
</FlowDocumentReader>
I can do an ugly fix with a DockPanel
, but that does not seem like the right way to do it.
<DockPanel Grid.Row="1" Grid.Column="1" Margin="20, 0" Background="White">
<DockPanel.Effect>
<DropShadowEffect BlurRadius="10" Color="Black" ShadowDepth="3" />
</DockPanel.Effect>
<FlowDocumentReader Grid.Row="1" Grid.Column="1" Name="rtbShowDoc" Background="White">
</FlowDocumentReader>
</DockPanel>
How can I set the background of a FlowDocumentReader?
EDIT: Added screenshot of running application. As you can see the dropshadow effect is applied to all text inside the FlowDocument
.
Upvotes: 0
Views: 2566
Reputation: 45096
Try setting the background of the FlowDocument
FlowDocument.Background Property
Upvotes: 2