Compartir a través de


IXRTextBlock (Compact 2013)

3/28/2014

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

Syntax

class IXRTextBlock : public IXRFrameworkElement

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRTextBlock

Methods

Method

Description

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 text 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::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::GetTextDecorations

Retrieves the text decorations that are applied to the text inside this text block element.

IXRTextBlock::GetTextTrimming

Retrieves the text trimming behavior to employ when content overflows the content area.

IXRTextBlock::GetTextWrapping

Retrieves a value that indicates how this text block wraps its text.

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::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::SetTextDecorations

Sets the text decorations that are applied to the text inside this text block element.

IXRTextBlock::SetTextTrimming

Sets the text trimming behavior to employ when content overflows the content area.

IXRTextBlock::SetTextWrapping

Sets a value that indicates how this text block wraps its text.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

The IXRTextBlock object is the primary element for displaying text in XAML for Windows Embedded-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 XAML 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.

When you create a class instance, use an IXRTextBlockPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

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

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

.NET Framework Equivalent

System.Windows.Controls.TextBlock

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management