Paragraph.FirstLineIndentType Property
Gets whether and how the first line in the paragraph is indented.
Namespace: DevExpress.Blazor.RichEdit
Assembly: DevExpress.Blazor.RichEdit.v24.1.dll
NuGet Package: DevExpress.Blazor.RichEdit
Declaration
public FirstLineIndentType? FirstLineIndentType { get; }
Property Value
Type | Description |
---|---|
Nullable<FirstLineIndentType> | The first line’s indent type. |
Available values:
Name | Description |
---|---|
None | The first line of a paragraph does not have any indent. |
Indented | The first line of a paragraph is indented to the right. |
Hanging | The first line of a paragraph is indented to the left. |
Remarks
The FirstLineIndent property defines the indent of the paragraph’s first line when the FirstLineIndentType
property is set to a value other than None
.
Use the ChangePropertiesAsync method to change whether and how the first line in a paragraph is indented.
<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.FirstLineIndentType != FirstLineIndentType.Indented)
properties.FirstLineIndentType = FirstLineIndentType.Indented;
});
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}
See Also