I'm a bit of a WPF/XAML newbie, so it is probably a very obvious question.
I added a new item to my project of the FlowDocument type. Let's call it CrappyFlowDocument.xaml
:
<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
ColumnWidth="400" FontSize="14" FontFamily="Georgia">
<Paragraph>
Woo, my first paragraph!
</Paragraph>
</FlowDocument>
I put it in a seperate file because I want to avoid putting big blobs of text in the middle of my PrettyInfoWindow
.
Now, in my PrettyInfoWindow
, I am stumped.
<FlowDocumentScrollViewer x:Name="flowDocViewer" Margin="0,0,0,0" Background="#FF414141" Zoom="80" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled" IsSelectionEnabled="False">
<!-- What do I put here-abouts to get my CrappyFlowDocument.xaml to show? -->
</FlowDocumentScrollViewer>
I can't find anything on the net about this kind of 'include' functionality, but probably my search-fu is horrible. If this isn't the intended purpose of a FlowDocument.xaml file, then what is?
here is how I would do it :
first, make your CrappyFlowDocument a resource by adding a key to it and putting it in a resource dictionary:
in App.xaml:
in your CrappyFlowDocument.xaml file:
then, call it directly as the FlowDocumentScrollViewer's "Document" property:
I'm not aware of an easier way to do this, hopefully this will suit your needs