Back to Devexpress

DiagramStencil.Shapes Property

corelibraries-devexpress-dot-diagram-dot-core-dot-diagramstencil.md

latest3.0 KB
Original Source

DiagramStencil.Shapes Property

Gets the collection of shapes associated with the stencil.

Namespace : DevExpress.Diagram.Core

Assembly : DevExpress.Diagram.v25.2.Core.dll

NuGet Package : DevExpress.Diagram.Core

Declaration

csharp
public IEnumerable<ShapeDescription> Shapes { get; }
vb
Public ReadOnly Property Shapes As IEnumerable(Of ShapeDescription)

Property Value

TypeDescription
IEnumerable<ShapeDescription>

A collection of objects implementing the DevExpress.Diagram.Core.IDiagramShape interface.

|

Remarks

To edit the Shapes collection, use the DiagramStencil.RegisterShape and DiagramStencil.UnregisterShape methods.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Shapes property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-diagram-create-custom-toolbox/CS/CustomDiagramToolboxExample/Form1.cs#L25

csharp
var toolboxItems = new ObservableCollection<DiagramShape>();
foreach (var shape in BasicShapes.Stencil.Shapes)
{

winforms-diagram-create-custom-toolbox/VB/CustomDiagramToolboxExample/Form1.vb#L25

vb
Dim toolboxItems = New System.Collections.ObjectModel.ObservableCollection(Of DevExpress.XtraDiagram.DiagramShape)()
For Each shape In DevExpress.Diagram.Core.BasicShapes.Stencil.Shapes
    toolboxItems.Add(New DevExpress.XtraDiagram.DiagramShape() With {.Shape = shape})

See Also

DiagramStencil Class

DiagramStencil Members

DevExpress.Diagram.Core Namespace