Back to Devexpress

ParagraphProperties.FirstLineIndentType Property

blazor-devexpress-dot-blazor-dot-richedit-dot-paragraphproperties.md

latest2.6 KB
Original Source

ParagraphProperties.FirstLineIndentType Property

Specifies whether and how the first line in the paragraph is indented.

Namespace : DevExpress.Blazor.RichEdit

Assembly : DevExpress.Blazor.RichEdit.v25.2.dll

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
public FirstLineIndentType? FirstLineIndentType { get; set; }

Property Value

TypeDescription
Nullable<FirstLineIndentType>

The first line’s indent type.

|

Available values:

NameDescription
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 specifies the indent of the paragraph’s first line when the FirstLineIndentType property is set to a value other than None.

Use the FirstLineIndentType property to get whether and how the first line in a paragraph is indented.

razor
<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

ParagraphProperties Class

ParagraphProperties Members

DevExpress.Blazor.RichEdit Namespace