MVCxDiagramContextToolboxSettings.Shapes Property

Lists the shapes that are displayed in the context toolbox.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v20.2.dll

Declaration

public MVCxDiagramToolboxShapeCollection Shapes { get; }
Public ReadOnly Property Shapes As MVCxDiagramToolboxShapeCollection

Property Value

Type Description
MVCxDiagramToolboxShapeCollection

An object that contains the shape collection.

Property Paths

You can access this nested property as listed below:

Object Type Path to Shapes
DiagramSettings

Remarks

Use the Shapes property to populate the context toolbox with a custom set of shapes. Every shape in the collection is represented by an object of the DiagramToolboxShape type. Use the Type property to add a default shape or the CustomShapeType property to add a custom shape to the context toolbox.

@Html.DevExpress().Diagram(settings => {
  settings.Name = "Diagram";
  settings.SettingsContextToolbox.Shapes.Add(s => { s.CustomShapeType = "pc"; });
  settings.SettingsContextToolbox.Shapes.Add(s => { s.CustomShapeType = "laptop"; });
  settings.SettingsContextToolbox.Shapes.Add(s => { s.CustomShapeType = "phone"; });
  settings.SettingsContextToolbox.Shapes.Add(s => { s.CustomShapeType = "mobile"; });
  settings.SettingsContextToolbox.Shapes.Add(s => { s.Type = DiagramShapeType.VerticalContainer; });
  settings.SettingsContextToolbox.Shapes.Add(s => { s.Type = DiagramShapeType.HorizontalContainer; });

  settings.CustomShapes.Add(c => {
    c.Type = "pc";
    c.Category = "hardware";
    ...
}).GetHtml()
NOTE

When the Shapes property is specified, the Category and CustomCategoryName properties are not in effect.

See Also