Permalink
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (90 sloc) 3.04 KB
<Window x:Class="TextElementSnippets.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="TextElementSnippets" Loaded="WindowLoaded"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0"/>
<RowDefinition Height="0"/>
<RowDefinition Height="0"/>
<RowDefinition Height="0"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
<!-- <Snippet_TextElement_BackgroundXAML> -->
<FlowDocumentReader>
<FlowDocument>
<Paragraph
Background="Bisque"
Foreground="DarkGreen"
Padding="4"
>
<Run>
This text has a foreground color of dark green, and a background color of bisque.
</Run>
</Paragraph>
</FlowDocument>
</FlowDocumentReader>
<!-- </Snippet_TextElement_BackgroundXAML> -->
</Border>
<Border Grid.Row="1">
<FlowDocumentReader>
<FlowDocument>
<!-- <Snippet_TextElement_FontPropsXAML> -->
<Paragraph
FontFamily="Century Gothic, Courier New"
FontSize="16pt"
FontStretch="UltraExpanded"
FontStyle="Italic"
FontWeight="DemiBold"
>
<Run>
This text will use the Century Gothic font (if available), with fallback to Courier New. It
will render with a font size of 16 points in ultra-expanded demi-bold italic.
</Run>
</Paragraph>
<!-- </Snippet_TextElement_FontPropsXAML> -->
</FlowDocument>
</FlowDocumentReader>
</Border>
<Border Grid.Row="2">
<FlowDocumentReader>
<FlowDocument>
<!-- <Snippet_TextElement_TypogXAML> -->
<Paragraph
TextAlignment="Left"
FontSize="18"
FontFamily="Palatino Linotype"
Typography.NumeralStyle="OldStyle"
Typography.Fraction="Stacked"
Typography.Variants="Inferior"
>
<Run>
This text has some altered typography characteristics. Note
that use of an open type font is necessary for most typographic
properties to be effective.
</Run>
<LineBreak/><LineBreak/>
<Run>
0123456789 10 11 12 13
</Run>
<LineBreak/><LineBreak/>
<Run>
1/2 2/3 3/4
</Run>
</Paragraph>
<!-- </Snippet_TextElement_TypogXAML> -->
</FlowDocument>
</FlowDocumentReader>
</Border>
<Border Grid.Row="3">
<FlowDocumentReader>
<FlowDocument Name="flowDoc"/>
</FlowDocumentReader>
</Border>
<Border Grid.Row="4">
<TextBlock Name="textBlock1"/>
</Border>
</Grid>
</Window>