Back to Devexpress

Selection.ActiveSubDocument Property

blazor-devexpress-dot-blazor-dot-richedit-dot-selection.md

latest1.5 KB
Original Source

Selection.ActiveSubDocument Property

Returns the active sub-document.

Namespace : DevExpress.Blazor.RichEdit

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

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
public SubDocument ActiveSubDocument { get; }

Property Value

TypeDescription
SubDocument

The active sub-document.

|

Remarks

razor
<DxRichEdit @bind-Selection="@selection" @ref="@richEdit" />

@code {
    DxRichEdit richEdit;
    Selection selection;
    @* ... *@
    /* 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 {
        @* ... *@
            // Checks whether the main sub-document is active
            if (selection.ActiveSubDocument.Type == SubDocumentType.Main)
            @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

See Also

Selection Class

Selection Members

DevExpress.Blazor.RichEdit Namespace