DiagramOptionsBehavior.Stencils Property

Provides access to the collection of available stencils.

Namespace: DevExpress.XtraDiagram.Options

Assembly: DevExpress.XtraDiagram.v20.1.dll

Declaration

[DefaultValue(null)]
[Browsable(false)]
public virtual DiagramStencilCollection Stencils { get; set; }
<DefaultValue(Nothing)>
<Browsable(False)>
Public Overridable Property Stencils As DiagramStencilCollection

Property Value

Type Default Description
DevExpress.Diagram.Core.DiagramStencilCollection

null

A DevExpress.Diagram.Core.DiagramStencilCollection object that is the collection of available stencils.

Property Paths

You can access this nested property as listed below:

Object Type Path to Stencils
DiagramControl
.OptionsBehavior.Stencils

Remarks

Use the Stencils property to register new or remove the default stencils.

See the example below.


var svgStencil = new DiagramStencil("SVGStencilId", "SVGStencilName");
using(var svgStream = File.OpenRead("Shape.svg")) {
    var svgShape = ShapeDescription.CreateSvgShape("SVGShapeId", "SVGShapeName", svgStream);
    svgStencil.RegisterShape(svgShape);
}
diagramControl.Stencils = new DiagramStencilCollection(svgStencil, BasicShapes.Stencil);

If the Stencils property is set to null, the diagram toolbox loads its stencils from the DiagramToolboxRegistrator.Stencils static collection.

See Also