corelibraries-devexpress-dot-diagram-dot-core-dot-diagramstencil.md
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
public IEnumerable<ShapeDescription> Shapes { get; }
Public ReadOnly Property Shapes As IEnumerable(Of ShapeDescription)
| Type | Description |
|---|---|
| IEnumerable<ShapeDescription> |
A collection of objects implementing the DevExpress.Diagram.Core.IDiagramShape interface.
|
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
var toolboxItems = new ObservableCollection<DiagramShape>();
foreach (var shape in BasicShapes.Stencil.Shapes)
{
winforms-diagram-create-custom-toolbox/VB/CustomDiagramToolboxExample/Form1.vb#L25
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