IXRTextBlock (Windows Embedded CE 6.0)

1/6/2010

This class provides a lightweight control for displaying small amounts of text content.

Syntax

class IXRTextBlock : public IXRFrameworkElement

Methods

Method Description

IXRTextBlock::GetBackground

Retrieves a Brush that provides the background of this text block.

IXRTextBlock::GetFontFamily

Retrieves the preferred top-level font family for the text in this text block.

IXRTextBlock::GetFontSize

Retrieves the font size for the text in this text block.

IXRTextBlock::GetFontSource

Retrieves the font source that is applied to this text block for displaying content.

IXRTextBlock::GetFontStretch

Retrieves a value that indicates how much a font is condensed or expanded on-screen.

IXRTextBlock::GetFontStyle

Retrieves the font style for the text in this text block.

IXRTextBlock::GetFontWeight

Retrieves the top-level font weight for this text block.

IXRTextBlock::GetForeground

Retrieves the Brush that paints the text in this text block.

IXRTextBlock::GetHighlightBackground

Retrieves the Brush used to paint the background of highlighted text in this text block.

IXRTextBlock::GetHighlightForeground

Retrieves the Brush used to paint text that is highlighted in this text block.

IXRTextBlock::GetHighlights

Retrieves a value that specifies a set of characters to be highlighted.

IXRTextBlock::GetInlines

Retrieves the collection of inline text elements in this text block.

IXRTextBlock::GetLineHeight

Retrieves the height of each line of text in this text block.

IXRTextBlock::GetLineStackingStrategy

Retrieves a value that indicates how a line box is determined for each line of text in this text block.

IXRTextBlock::GetPadding

Retrieves a value that indicates the width of padding space between the boundaries of the content area and the content that is displayed by a text block.

IXRTextBlock::GetText

Retrieves the text contents of this text block.

IXRTextBlock::GetTextAlignment

Retrieves a value that indicates the horizontal alignment of text content inside this text block.

IXRTextBlock::GetTextWrapping

Retrieves how this text block wraps its text.

IXRTextBlock::SetBackground

Sets the Brush that provides the background of this text block.

IXRTextBlock::SetFontFamily

Sets the preferred top-level font family for the text in this text block.

IXRTextBlock::SetFontSize

Sets the font size for the text in this text block.

IXRTextBlock::SetFontSource

Sets the font source that is applied to this text block for displaying text content.

IXRTextBlock::SetFontStretch

Sets a value that indicates how much a font is condensed or expanded on-screen.

IXRTextBlock::SetFontStyle

Sets the font style for the text in this text block.

IXRTextBlock::SetFontWeight

Sets the top-level font weight for this text block.

IXRTextBlock::SetForeground

Sets the Brush to use to paint the text in this text block.

IXRTextBlock::SetHighlightBackground

Sets a Brush to use to paint the background of highlighted text in this text block.

IXRTextBlock::SetHighlightForeground

Sets the Brush to use to paint text that is highlighted in this text block.

IXRTextBlock::SetHighlights

Sets a value that specifies a set of characters to be highlighted.

IXRTextBlock::SetInlines

Sets the collection of inline text elements in this text block.

IXRTextBlock::SetLineHeight

Sets the height of each line of text in this text block.

IXRTextBlock::SetLineStackingStrategy

Sets a value that indicates how a line box is determined for each line of text in this text block.

IXRTextBlock::SetPadding

Sets a value that indicates the width of padding space between the boundaries of the content area and the content that is displayed by a text block.

IXRTextBlock::SetText

Sets the text contents of this text block.

IXRTextBlock::SetTextAlignment

Sets a value that indicates the horizontal alignment of text content inside this text block.

IXRTextBlock::SetTextWrapping

Sets how this text block wraps its text.

Remarks

The IXRTextBlock object is the primary element for displaying text in Silverlight–based applications.

Note

Leading or trailing white space is not preserved when you set the Text property by calling IXRTextBlock::SetText.

You can align the IXRTextBlock object within the layout of the window by using IXRTextBox::SetTextAlignment, and the inherited methods IXRFrameworkElement::SetVerticalAlignment and IXRFrameworkElement::SetHorizontalAlignment.

The IXRRun and IXRLineBreak objects in the visual tree represent the <Run> and <LineBreak> XAML elements, which are used to render formatted text. These XAML elements are parsed into objects at run time by Silverlight for Windows Embedded. The IXRRun object is a text element that represents a discrete section of formatted or unformatted text. The IXRLineBreak object represents an explicit new line in an IXRTextBlock. If these XAML elements are used to define inner text, the corresponding run-time objects can be accessed from the inlines collection that is retrieved by IXRTextBlock::GetInlines.

You can also define a text block in Microsoft Silverlight 2 XAML. For information about the differences between XAML in Silverlight for Windows Embedded and Silverlight 2, see Differences Between Silverlight for the Web and Silverlight for Windows Embedded. For more information about how to define this element in the source XAML for your application, see this Microsoft Web site.

When you set text in a XAML <TextBlock> element instead of by using IXRTextBlock, it is not necessary in XAML to explicitly specify the Text property. You can put text in the <TextBlock> element as its content, or inner text. For more information about how to set a text block in the source XAML for your application, see the Microsoft Silverlight 2 documentation.

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRTextBlock

.NET Framework Equivalent

System.Windows.Controls.TextBlock

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

Classes for UI Element Management

Other Resources