using System; using System.Collections.Generic; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes;
namespace Documents
{ public partial class FlowContent : System.Windows.Window
{ public FlowContent()
{
InitializeComponent();
} private void cmdCreateDynamicDocument_Click(object sender, RoutedEventArgs e)
{
Run runFirst = new Run();
runFirst.Text = "A ";
Bold bold = new Bold();
Run runBold = new Run();
runBold.Text = "bold ";
bold.Inlines.Add(runBold);
Run runLast = new Run();
runLast.Text = " documents";
Paragraph paragraph = new Paragraph();
paragraph.Inlines.Add(runFirst);
paragraph.Inlines.Add(bold);
paragraph.Inlines.Add(runLast);
FlowDocument document = new FlowDocument();
document.Blocks.Add(paragraph);