Skip to main content

FloatingObjectDistanceFromText Class

Contains settings that specify distances between the floating object borders and text that wraps around the object.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v24.1.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public class FloatingObjectDistanceFromText :
    IFloatingObjectDistanceFromText

The following members return FloatingObjectDistanceFromText objects:

Remarks

Use the DistanceFromText property to get distances between borders of an image and text that wraps around the image. The ChangePropertiesAsync method allows you to set these distances.

<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.DistanceFromText.Bottom < UnitConverter.InchesToTwips(1)) {
                    properties.DistanceFromText.Bottom = UnitConverter.InchesToTwips(1);
                    properties.DistanceFromText.Left = UnitConverter.CentimetersToTwips(1);
                    properties.DistanceFromText.Right = UnitConverter.CentimetersToTwips(1);
                    properties.DistanceFromText.Top = UnitConverter.InchesToTwips(1);
                }
            });
            @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

Inheritance

Object
FloatingObjectDistanceFromText
See Also