Margins Class

Contains margin settings.

Namespace: DevExpress.Blazor.RichEdit

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

Declaration

public class Margins :
    IMargins

The following members accept/return Margins objects:

Remarks

<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 cancelled. */
        try {
            documentAPI = richEdit.DocumentAPI;
            @* ... *@
            var sections = await documentAPI.Sections.GetAllAsync();
            foreach (Section s in sections)
                await s.ChangePropertiesAsync(properties => {
                    if (s.Margins.Left != 700)
                        properties.Margins.Left = 700;
                    if (s.Margins.Right != 700)
                        properties.Margins.Right = 700;
                    if (s.Margins.Top != 567)
                        properties.Margins.Top = 567;
                    if (s.Margins.Bottom != 567)
                        properties.Margins.Bottom = 567;
                });
                @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

Implements

Inheritance

Object
Margins
See Also