Skip to main content

MVCxDiagramCustomShapeCollection Class

A collection of custom shapes.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public class MVCxDiagramCustomShapeCollection :
    Collection<DiagramCustomShape>

The following members return MVCxDiagramCustomShapeCollection objects:

Remarks

The MVCxDiagramCustomShapeCollection is a collection of DiagramCustomShape objects.

An instance of the MVCxDiagramCustomShapeCollection class can be accessed via the CustomShapes property.

@Html.DevExpress().Diagram(settings => {
    settings.Name = "Diagram";
    settings.SettingsToolbox.Groups.Add(g => {
        g.Category = DevExpress.Web.ASPxDiagram.DiagramShapeCategory.Custom;
        g.CustomCategoryName = "hardware";
        g.Title = "Hardware";
    });
    settings.CustomShapes.Add(c => {
        c.Type = "internet";
        c.Category = "hardware";
        c.Title = "Internet";
        c.BackgroundImageUrl = "../Content/customshapes/shapes/internet.svg";
        c.BackgroundImageLeft = 0.15M;
        c.BackgroundImageTop = 0;
        c.BackgroundImageWidth = 0.7M;
        c.BackgroundImageHeight = 0.7M;
        c.DefaultWidth = 0.75M;
        c.DefaultHeight = 0.75M;
        c.DefaultText = "Internet";
        c.AllowEditText = true;
        c.TextLeft = 0;
        c.TextTop = 0.7M;
        c.TextWidth = 1;
        c.TextHeight = 0.3M;
        c.ConnectionPoints.Add(0.5M, 0);
        c.ConnectionPoints.Add(0.9M, 0.5M);
        c.ConnectionPoints.Add(0.5M, 1);
        c.ConnectionPoints.Add(0.1M, 0.5M);
    });
    ...
}).Import(Model).GetHtml()

Run Demo: Custom Shapes

Implements

DevExpress.Web.Internal.IStateManagerTracker
DevExpress.Web.Internal.IPropertiesDirtyTracker
DevExpress.Utils.IAssignableCollection

Inheritance

See Also