Back to Devexpress

FloatingObjectVerticalAnchorElement Enum

blazor-devexpress-dot-blazor-dot-richedit-e12cac48.md

latest2.7 KB
Original Source

FloatingObjectVerticalAnchorElement Enum

Lists values that specify the element to which the floating object is vertically aligned.

Namespace : DevExpress.Blazor.RichEdit

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

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
public enum FloatingObjectVerticalAnchorElement

Members

NameDescription
Page

A floating object is aligned to a page.

| | Line |

A floating object is aligned to a line.

| | Paragraph |

A floating object is aligned to a paragraph.

| | Margin |

A floating object is aligned to the top or bottom page margin, or centered vertically.

| | TopMargin |

A floating object is aligned to the top margin.

| | BottomMargin |

A floating object is aligned to the bottom margin.

| | InsideMargin |

Currently not supported and is treated as the TopMargin anchor element.
Floating objects are aligned to the top margin for odd pages, and the bottom margin for even pages.

| | OutsideMargin |

Currently not supported and is treated as the BottomMargin anchor element.
Floating objects are aligned to the bottom margin for odd pages, and the top margin for even pages.

|

The following properties accept/return FloatingObjectVerticalAnchorElement values:

Remarks

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;
            @* ... *@
            Image firstImage = await documentAPI.Images.GetAsync(0);
            @* ... *@
            await firstImage.ChangePropertiesAsync(properties => {
                if (firstImage.VerticalAnchorElement != FloatingObjectVerticalAnchorElement.Page)
                    properties.VerticalAnchorElement = FloatingObjectVerticalAnchorElement.Page;
            });
            @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

See Also

DevExpress.Blazor.RichEdit Namespace