menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class Ruler

    Represents the class which contains the data and functionlities to the rulers used in SfDiagram control.

    Inheritance
    System.Object
    Ruler
    Namespace: Syncfusion.UI.Xaml.Diagram.Controls
    Assembly: Syncfusion.SfDiagram.WPF.dll
    Syntax
    public class Ruler : ContentControl

    Constructors

    Ruler()

    Initializes a new instance of the Ruler class.

    Declaration
    public Ruler()

    Fields

    MarkerBrushProperty

    Provides information about the MarkerBrush property.

    Declaration
    public static readonly DependencyProperty MarkerBrushProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    OffsetProperty

    Provides information about the Offset property.

    Declaration
    public static DependencyProperty OffsetProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    OrientationProperty

    Provides information about the Orientation property.

    Declaration
    public static DependencyProperty OrientationProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ScaleProperty

    Provides information about the Scale property.

    Declaration
    public static DependencyProperty ScaleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ThicknessProperty

    Provides information about the Thickness property.

    Declaration
    public static DependencyProperty ThicknessProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    Properties

    MarkerBrush

    Gets or sets the marker brush applied to the position indicator on rulers.

    Declaration
    public Brush MarkerBrush { get; set; }
    Property Value
    Type Description
    System.Windows.Media.Brush

    The color of the ruler position indicator. Default is Black.

    Examples

    The following XAML demonstrates how to use the MarkerBrush property:

    <syncfusion:SfDiagram.HorizontalRuler>
        <syncfusion:Ruler MarkerBrush="Red"/>
    </syncfusion:SfDiagram.HorizontalRuler>
    <syncfusion:SfDiagram.VerticalRuler>
        <syncfusion:Ruler Orientation="Vertical" MarkerBrush="Green"/>
    </syncfusion:SfDiagram.VerticalRuler>

    Offset

    Gets or sets the offset values to the ruler which is position to the rulers.

    Declaration
    public double Offset { get; set; }
    Property Value
    Type
    System.Double

    Orientation

    Gets or sets the orientation value to the ruler.

    Declaration
    public Orientation Orientation { get; set; }
    Property Value
    Type
    System.Windows.Controls.Orientation

    Scale

    Gets or sets the scale factor value to the rulers.

    Declaration
    public double Scale { get; set; }
    Property Value
    Type
    System.Double

    Thickness

    Gets or sets the thickness value of the rulers.

    Declaration
    public double Thickness { get; set; }
    Property Value
    Type
    System.Double

    Methods

    ArrangeOverride(Size)

    Overridden to positions the ruler and its segements and determines the arranged size of the ruler.

    Declaration
    protected override Size ArrangeOverride(Size finalSize)
    Parameters
    Type Name Description
    System.Windows.Size finalSize

    The size of the rulers in which size the ruler is going to be arranged.

    Returns
    Type Description
    System.Windows.Size

    The size of the ruler control.

    GetNewSegment()

    Creats and returns the new instance of RulerSegment class.

    Declaration
    protected virtual RulerSegment GetNewSegment()
    Returns
    Type Description
    RulerSegment

    Returns the RulerSegmentclass instance.

    MeasureOverride(Size)

    Overridden to measure the size of the ruler and its segments and determines a size for the ruler control.

    Declaration
    protected override Size MeasureOverride(Size availableSize)
    Parameters
    Type Name Description
    System.Windows.Size availableSize

    The size of the ruler control in which size the elements are going to measure.

    Returns
    Type Description
    System.Windows.Size

    Returns the size of the ruler control.

    OnApplyTemplate()

    Overridden to apply the templates values to the elements of rulers.

    Declaration
    public override void OnApplyTemplate()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved