Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| // <SnippetSectionCodeOnlyExampleWholePage> | |
| using System; | |
| using System.Windows; | |
| using System.Windows.Media; | |
| using System.Windows.Controls; | |
| using System.Windows.Documents; | |
| namespace SDKSample | |
| { | |
| public partial class SectionExample : Page | |
| { | |
| public SectionExample() | |
| { | |
| // Create three paragraphs | |
| Paragraph myParagraph1 = new Paragraph(new Run("Paragraph 1")); | |
| Paragraph myParagraph2 = new Paragraph(new Run("Paragraph 2")); | |
| Paragraph myParagraph3 = new Paragraph(new Run("Paragraph 3")); | |
| // Create a Section and add the three paragraphs to it. | |
| Section mySection = new Section(); | |
| mySection.Background = Brushes.Red; | |
| mySection.Blocks.Add(myParagraph1); | |
| mySection.Blocks.Add(myParagraph2); | |
| mySection.Blocks.Add(myParagraph3); | |
| // Create a FlowDocument and add the section to it. | |
| FlowDocument myFlowDocument = new FlowDocument(); | |
| myFlowDocument.Blocks.Add(mySection); | |
| this.Content = myFlowDocument; | |
| } | |
| } | |
| } | |
| // </SnippetSectionCodeOnlyExampleWholePage> |