TextBlock | 111
Elements
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
ScG="0.0"
ScB="1.0" />
</SolidColorBrush.Color>
</SolidColorBrush>
<SolidColorBrush .../> defines a Brush that paints an object or region in a solid color.
Attributes
Color (required)
Defines the color of the
Brush either using one of the predefined colors or one
described by using
ScRGB values.
TextBlock
Hierarchy: UIElement FrameworkElement
<TextBlock
TextAlignment="Center|End|Justify|Left|Right|Start"
TextWrap="Wrap|NoWrap|Emergency"
TextTrimming="CharacterEllipsis|WordEllipsis|None"
TextEffects="Collection"
TextContent="Lorem ipsum dolar sit amet, consecteteur adipscing elit."
BaselineOffset="10" />
or:
<TextBlock
TextAlignment="Center|End|Justify|Left|Right|Start"
TextWrap="Wrap|NoWrap|Emergency"
TextTrimming="CharacterEllipsis|WordEllipsis|None"
TextEffects="Collection"
BaselineOffset="10">
Lorem ipsum dolar sit amet, consecteteur adipscing elit.
</TextBlock>
<TextBlock .../> displays a block of text. TextBlock is similar to Paragraph in terms of
formatting and display, but
TextBlock is a UIElement, which means that it can be used
outside the context of documents. This element is optimized for UI display.
Attributes
BaselineOffset (optional)
The amount to adjust the baseline offset position. Essentially, this drops the text
down the specified distance. This attribute is attached to inline children of
TextBlock. The following code fragment raises the baseline of the inline TextBlock
so that the text appears above the surrounding text:
<TextBlock>
This text is normal.
<TextBlock BaselineOffset="20">This text is raised</TextBlock>
This text is normal again.
</TextBlock>
TextAlignment (optional)
Describes how text is aligned horizontally.

Get XAML in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.