Class FlowDocumentTextFormatExtensions
Fluent type extensions for manipulating FlowDocument objects focused on text element formatting.
Inherited Members
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.Wpf.FlowDocumentExtensions.dll
Syntax
public static class FlowDocumentTextFormatExtensions
Methods
| Edit this page View SourceBackground<TElement>(TElement, Brush)
Sets a background color for a TextElement.
Declaration
public static TElement Background<TElement>(this TElement element, Brush value) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to which the background color will be applied. |
| Brush | value | Background to apply. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to which the background color will be applied. |
Bold<TElement>(TElement)
Sets the text format to bold.
Declaration
public static TElement Bold<TElement>(this TElement element) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Center<TElement>(TElement)
Sets the text alignment to center.
Declaration
public static TElement Center<TElement>(this TElement element) where TElement : Block
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Effect<TElement>(TElement, TextEffect)
Sets a text effect on a TextElement.
Declaration
public static TElement Effect<TElement>(this TElement element, TextEffect effect) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
| TextEffect | effect | Effect to apply to the text. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Foreground<TElement>(TElement, Brush)
Sets a foreground color for a TextElement.
Declaration
public static TElement Foreground<TElement>(this TElement element, Brush value) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to which the foreground color will be applied. |
| Brush | value | Foreground color to apply. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to which the foreground color will be applied. |
Format<TElement>(TElement, double)
Sets the format of a TextElement.
Declaration
public static TElement Format<TElement>(this TElement element, double fontSize) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
| double | fontSize | Font size. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Format<TElement>(TElement, FontStretch)
Sets the format of a TextElement.
Declaration
public static TElement Format<TElement>(this TElement element, FontStretch fontStretch) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
| FontStretch | fontStretch | Font stretch. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Format<TElement>(TElement, FontStyle)
Sets the format of a TextElement.
Declaration
public static TElement Format<TElement>(this TElement element, FontStyle fontStyle) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
| FontStyle | fontStyle | Font style. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Format<TElement>(TElement, FontWeight)
Sets the format of a TextElement.
Declaration
public static TElement Format<TElement>(this TElement element, FontWeight fontWeight) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
| FontWeight | fontWeight | Font weight. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Format<TElement>(TElement, FontFamily)
Sets the format of a TextElement.
Declaration
public static TElement Format<TElement>(this TElement element, FontFamily fontFamily) where TElement : TextElement
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
| FontFamily | fontFamily | Font family to use. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Format<TElement>(TElement, TextAlignment)
Sets the format of a TextElement.
Declaration
public static TElement Format<TElement>(this TElement element, TextAlignment alignment) where TElement : Block
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
| TextAlignment | alignment | Text alignment. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Justify<TElement>(TElement)
Sets the text alignment to justified.
Declaration
public static TElement Justify<TElement>(this TElement element) where TElement : Block
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Left<TElement>(TElement)
Sets the text alignment to left.
Declaration
public static TElement Left<TElement>(this TElement element) where TElement : Block
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |
Right<TElement>(TElement)
Sets the text alignment to right.
Declaration
public static TElement Right<TElement>(this TElement element) where TElement : Block
Parameters
| Type | Name | Description |
|---|---|---|
| TElement | element | TextElement to manipulate. |
Returns
| Type | Description |
|---|---|
| TElement |
|
Type Parameters
| Name | Description |
|---|---|
| TElement | Type of TextElement to manipulate. |