New to Telerik UI for WPFStart a free 30-day trial

IRadTextBlock

Interface

Represents a text block in the Telerik UI framework.

Definition

Namespace:Telerik.Windows.Documents.UI.TextBlocks

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
public interface IRadTextBlock

Properties

FlowDirection

FlowDirection

Gets or sets the flow direction of the text block.

C#
FlowDirection FlowDirection { get; set; }
Property Value:

A FlowDirection value that indicates the direction in which the text flows.

FontFamily

FontFamily

Gets or sets the font family of the text block.

C#
FontFamily FontFamily { get; set; }
Property Value:

The font family to be applied to the text block. This property influences the appearance of the text rendered within the block.

Gets or sets the font size of the text block.

C#
double FontSize { get; set; }
Property Value:

A double representing the size of the font in device-independent pixels (DIPs).

FontStyle

FontStyle

Gets or sets the font style of the text block.

C#
FontStyle FontStyle { get; set; }
Property Value:

The font style to be applied to the text block. This can specify various styles like normal, italic, or oblique.

FontWeight

FontWeight

Gets or sets the font weight of the text block.

C#
FontWeight FontWeight { get; set; }

Gets or sets the foreground color of the text block.

C#
Color ForegroundColor { get; set; }
Property Value:

A Color that represents the foreground color of the text block.

Gets or sets the height of the text block in document units.

C#
double Height { get; set; }
Property Value:

A double representing the height of the text block. The value is measured in document units.

Gets or sets the left position of the text block.

C#
double Left { get; set; }
Property Value:

A double representing the left position in units relative to the layout's coordinate system.

C#
double LineBaselineOffset { get; set; }
C#
double LineHeight { get; set; }

Gets or sets the text content of the RadTextBlock.

C#
string Text { get; set; }
Property Value:

The text content as a string.

Gets the vertical position of the top edge of the text block.

C#
double Top { get; set; }

Gets or sets the width of the text block.

C#
double Width { get; set; }
Property Value:

A double representing the width of the text block in pixels.

Methods

Setting the formatting properties to their default values.

C#
void ClearFormattingProperties()

Clears all inline elements from the text block.

C#
void ClearInlines()

Retrieves the baseline offset of the text block.

C#
double GetBaselineOffset()
Returns:

double

A value of type double representing the baseline offset.

Gets the baseline rendering difference for the specified vertical position.

C#
double GetBaselineRenderingDifference(double lineBaselineOffset)
Parameters:lineBaselineOffsetdouble

The vertical position used to calculate the baseline rendering difference.

Returns:

double

The baseline rendering difference as a double value.

GetUIElement()

FrameworkElement

Retrieves the user interface element associated with the text block.

C#
FrameworkElement GetUIElement()
Returns:

FrameworkElement

The UI element that represents the text block. This can be used for rendering or interaction purposes.

Determines whether the current RadTextBlock has any inline elements.

C#
bool HasInlines()
Returns:

bool

True if the RadTextBlock contains inline elements; otherwise, false.

Releases resources and clears any inline elements associated with the text block.

C#
void ReleaseAndClearInlines(ObjectPool pool)
Parameters:poolObjectPool

An instance of the ObjectPool used to manage memory allocation for inlines.

Sets the clipping region for the text block.

C#
void SetClip(Rect? rect)
Parameters:rectRect?

The rectangle that defines the clipping region. If null, no clipping will be applied.

Setting the formatting properties from the provided SpanProperties.

C#
void SetFormattingProperties(SpanProperties spanProperties)
Parameters:spanPropertiesSpanProperties

The properties.

Sets the inlines for the text block with the specified collection of runs.

C#
void SetInlines(IEnumerable<IRadRun> runs)
Parameters:runsIEnumerable<IRadRun>

An enumerable collection of IRadRun that represents the inlines to be set.