DiagramControl.Stencils Property
In This Article
Provides access to the collection of available stencils. This is a dependency property.
Namespace: DevExpress.Xpf.Diagram
Assembly: DevExpress.Xpf.Diagram.v24.2.dll
NuGet Package: DevExpress.Wpf.Diagram
#Declaration
#Property Value
Type | Description |
---|---|
DevExpress. |
A DevExpress. |
#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