Paragraph.LineSpacingType Property
Gets the line spacing type.
Namespace: DevExpress.Blazor.RichEdit
Assembly: DevExpress.Blazor.RichEdit.v24.1.dll
NuGet Package: DevExpress.Blazor.RichEdit
Declaration
public LineSpacingType? LineSpacingType { get; }
Property Value
Type | Description |
---|---|
Nullable<LineSpacingType> | The line spacing type. |
Available values:
Name | Description |
---|---|
Single | The single line spacing. |
Sesquialteral | The line spacing is one-and-one-half times that of single spacing. |
Double | The double line spacing. |
Multiple | Allows you to set line spacing that is several times that of single spacing. Use the LineSpacing property to specify the spacing value in numbers greater than 1 (for instance, the 1.75 number specifies line spacing that is 75 percent higher than the Single spacing). |
Exactly | Allows you to specify the exact line spacing. Use the LineSpacing property to specify the spacing value in twips. |
AtLeast | Allows you to specify the minimum line spacing that RichEdit can increase to fit the font or graphic on the line. Use the LineSpacing property to specify the minimum spacing value in twips. |
Remarks
The LineSpacing property defines the line spacing value when the lineSpacingType
property is set to Exactly
, AtLeast
, or Multiple
. When the lineSpacingType
property is set to Single
, Sesquialteral
, or Double
, the LineSpacing property is not in effect and the line spacing value is based on the height of the text.
Use the ChangePropertiesAsync method to change a paragraph’s line spacing type.
<DxRichEdit @ref="richEdit" />
@code {
DxRichEdit richEdit;
Document documentAPI;
/* Surround the code that contains an asynchronous operation with a try-catch block to handle
the OperationCanceledException. This exception is thrown when an asynchronous operation is canceled. */
try {
documentAPI = richEdit.DocumentAPI;
IReadOnlyList<Paragraph> paragraphs = await documentAPI.Paragraphs.GetAllAsync();
foreach (Paragraph p in paragraphs)
await p.ChangePropertiesAsync(properties => {
if (p.LineSpacingType != LineSpacingType.Exactly)
properties.LineSpacingType = LineSpacingType.Exactly;
});
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}