Back to Devexpress

FloatingObjectHorizontalAlignment Enum

blazor-devexpress-dot-blazor-dot-richedit-c053b1e2.md

latest3.2 KB
Original Source

FloatingObjectHorizontalAlignment Enum

Lists values that specify the horizontal alignment for a floating object.

Namespace : DevExpress.Blazor.RichEdit

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

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
public enum FloatingObjectHorizontalAlignment

Members

NameDescription
None

A floating object is not aligned.

| | Left |

A floating object is aligned to the left side of a horizontal anchor element.

| | Center |

A floating object is aligned to the center of a horizontal anchor element.

| | Right |

A floating object is aligned to the right side of a horizontal anchor element.

| | Inside |

Currently not supported and is displayed as the Left alignment type. Floating objects are aligned to the left side of a horizontal anchor element for odd pages, and the right side of a horizontal anchor element for even pages.

| | Outside |

Currently not supported and is displayed as the Right alignment type. Floating objects are aligned to the right side of a horizontal anchor element for odd pages, and the left side of a horizontal anchor element for even pages.

|

The following properties accept/return FloatingObjectHorizontalAlignment 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.HorizontalAlignment != FloatingObjectHorizontalAlignment.Center)
                    properties.HorizontalAlignment = FloatingObjectHorizontalAlignment.Center;
            });
            @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

See Also

DevExpress.Blazor.RichEdit Namespace