menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RulerSettings - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RulerSettings

    Represents the ruler settings for the SfDiagramComponent that controls the visibility and appearance of horizontal and vertical rulers.

    Inheritance
    System.Object
    RulerSettings
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class RulerSettings : OwningComponentBase
    Remarks

    The RulerSettings class manages the display and customization options for both horizontal and vertical rulers within the diagram component.

    It provides comprehensive control over ruler visibility, intervals, colors, and tick alignment.

    This class serves as a container for HorizontalRuler and VerticalRuler settings, allowing independent configuration of each ruler's properties.

    Examples

    This example demonstrates how to configure both horizontal and vertical rulers with custom appearance settings.

        <SfDiagramComponent Height="600px">
            <RulerSettings>
                <HorizontalRuler IsVisible = "true" Interval="7"  MarkerColor="red" TickAlignment="TickAlignment.RightAndBottom">
                </HorizontalRuler>
                <VerticalRuler IsVisible = "true" Interval="7"  MarkerColor = "blue" TickAlignment = "TickAlignment.RightAndBottom">
                </VerticalRuler>
            </RulerSettings>
        </SfDiagramComponent>

    Constructors

    RulerSettings()

    Declaration
    public RulerSettings()

    Properties

    ChildContent

    Gets or sets the child content of the RulerSettings.

    Declaration
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    Accepts a RenderFragment that defines the content of the UI element.

    HorizontalRuler

    Gets or sets the appearance settings for the horizontal ruler.

    Declaration
    public HorizontalRuler HorizontalRuler { get; set; }
    Property Value
    Type Description
    HorizontalRuler

    A HorizontalRuler object that defines the horizontal ruler's appearance settings.

    Remarks

    This property allows customization of appearance of the horizontal ruler.

    It includes visibility, interval spacing, marker colors, and tick alignment.

    The horizontal ruler provides visual measurement guides along the horizontal axis of the diagram canvas.

    Examples
        <SfDiagramComponent Height = "600px">
            <RulerSettings>
                <HorizontalRuler IsVisible = "true" Interval="7"  MarkerColor="red" TickAlignment="TickAlignment.RightAndBottom">
                </HorizontalRuler>
            </RulerSettings>
        </SfDiagramComponent>

    VerticalRuler

    Gets or sets the appearance and behavior settings for the vertical ruler in the diagram component.

    Declaration
    public VerticalRuler VerticalRuler { get; set; }
    Property Value
    Type Description
    VerticalRuler

    A VerticalRuler object that defines the vertical ruler configuration, or null if not specified.

    Remarks

    The vertical ruler provides visual measurement guides along the left or right edge of the diagram canvas.

    This property allows customization of the vertical ruler's .

    Examples

    The following example demonstrates how to configure the vertical ruler with custom settings.

     
    
        <SfDiagramComponent Height = "600px">
            <RulerSettings> 
                <VerticalRuler IsVisible = "true" Interval="7"  MarkerColor = "blue" TickAlignment = "TickAlignment.RightAndBottom"> 
                </VerticalRuler> 
            </RulerSettings> 
        </SfDiagramComponent> 

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    OnAfterRenderAsync(Boolean)

    Method invoked after each time the component has been rendered.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender

    Set to true for the first time component rendering; otherwise gets false.

    Returns
    Type
    System.Threading.Tasks.Task

    OnInitializedAsync()

    Method invoked when the component is ready to start.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    OnParametersSetAsync()

    Method invoked when any changes in component state occur.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    ="Task".

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved