menu

Blazor

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

    Show / Hide Table of Contents

    Class DecoratorSettings

    Represents the shape and style configuration for the end points of a Connector in a diagram.

    Inheritance
    System.Object
    DiagramObject
    DecoratorSettings
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DecoratorSettings : DiagramObject, IDiagramObject, ICloneable
    Remarks

    This class provides options to customize the appearance and dimensions of decorator shapes, such as arrows, diamonds, or custom path shapes.

    Users can specify the shape, width, height, style, and pivot point of the decorator for tailored visual presentations on diagram connectors.

    Constructors

    DecoratorSettings()

    Initializes a new instance of the Decorator.

    Declaration
    public DecoratorSettings()

    DecoratorSettings(DecoratorSettings)

    Creates a new instance of the Decorator from the given Decorator.

    Declaration
    public DecoratorSettings(DecoratorSettings src)
    Parameters
    Type Name Description
    DecoratorSettings src

    The source DecoratorSettings to copy from.

    Properties

    Height

    Gets or sets the height of the decorator.

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

    A System.Double representing the decorator height. The default value is 10.

    Examples
    TargetDecorator = new DecoratorSettings()
    {
       Width = 15, Height = 15, Shape = DecoratorShape.Square
        Style = new ShapeStyle()
        {
            StrokeColor = "#37909A",
            Fill = "#37909A",
            StrokeWidth = 1,
        }
    }

    PathData

    Gets or sets the PathData for a custom shape of the decorator.

    Declaration
    public string PathData { get; set; }
    Property Value
    Type Description
    System.String

    A System.String that contains the SVG path data representation of the decorator shape. The default value is null.

    Remarks

    This property allows for the specification of a custom path for the decorator by using SVG path data. When set to null, the default decorator shape will be used.

    Ensure that the provided path data forms a closed shape to achieve proper rendering.

    Examples

    Demonstrates how to set a custom decorator shape using SVG path data.

    TargetDecorator = new DecoratorSettings()
    {
        Shape = DecoratorShape.Custom,
        PathData = "M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5 C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",
        Style = new ShapeStyle()
        {
            StrokeColor = "#37909A",
            Fill = "#37909A",
            StrokeWidth = 1,
        }
    }

    Pivot

    Gets or sets the pivot point of the decorator, which determines the rotation angle. The pivot values range from 0 to 1, indicating the relative position of the pivot point within the decorator's bounds.

    Declaration
    public DiagramPoint Pivot { get; set; }
    Property Value
    Type Description
    DiagramPoint

    A DiagramPoint representing the pivot point for the decorator.

    Remarks

    The decorator angle is affected by the pivot point, allowing for customized positioning.

    Examples
    TargetDecorator = new DecoratorSettings()
    {
       Width = 15, Height = 15, Shape = DecoratorShape.Square,
       Pivot = new DiagramPoint { X = 0, Y = 0.5 },
       Style = new ShapeStyle()
       {
           StrokeColor = "#37909A",
           Fill = "#37909A",
           StrokeWidth = 1,
       }
    }

    Shape

    Gets or sets the DecoratorShape used for the connector's decorator.

    Declaration
    public DecoratorShape Shape { get; set; }
    Property Value
    Type Description
    DecoratorShape

    A DecoratorShape specifying the shape of the decorator. The default value is Arrow.

    Remarks

    The following options define the shape of the connector:

    • Arrow - Sets the decorator’s shape to an arrow.
    • None - Sets the decorator's shape to none.
    • Diamond - Sets the decorator's shape to a diamond.
    • OpenArrow - Sets the decorator shape to an open-arrow.
    • Circle - Sets the decorator shape to a circle.
    • Square - Sets the decorator shape to a square.
    Examples
    TargetDecorator = new DecoratorSettings()
    {
       Width = 15, Height = 15, Shape = DecoratorShape.Square,
       Style = new ShapeStyle()
        {
            StrokeColor = "#37909A",
            Fill = "#37909A",
            StrokeWidth = 1,
        }
    }

    Style

    Gets or sets the ShapeStyle of the decorator, which represents the appearance of the decorator.

    Declaration
    public ShapeStyle Style { get; set; }
    Property Value
    Type Description
    ShapeStyle

    A ShapeStyle representing the style of the decorator. The default value is null meaning no specific style is set.

    Remarks

    The ShapeStyle contains various properties like StrokeColor, Fill, and StrokeWidth which determine the styling of the decorator.

    Examples

    Here is an example of how to set the style for a decorator:

    // Setting the style for the target decorator
    TargetDecorator = new DecoratorSettings()
    {
       Width = 15, Height = 15, Shape = DecoratorShape.Square,
       Pivot = new DiagramPoint { X = 0, Y = 0.5 },
       Style = new ShapeStyle()
       {
           StrokeColor = "#37909A",
           Fill = "#37909A",
           StrokeWidth = 1,
       }
    };

    Width

    Gets or sets the width of the decorator.

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

    A System.Double representing the decorator width. The default value is 10.

    Examples
    // Create a decorator for a target with specific dimensions and style
    TargetDecorator = new DecoratorSettings()
    {
        Width = 15, Height = 15, Shape = DecoratorShape.Square,
        Style = new ShapeStyle()
        {
            StrokeColor = "#37909A",
            Fill = "#37909A",
            StrokeWidth = 1,
        }
    }

    Methods

    Clone()

    Creates a new instance of the DecoratorSettings class that is a copy of the current instance.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    A new DecoratorSettings instance that is a copy of this instance.

    Overrides
    DiagramObject.Clone()

    Implements

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