Back to Devexpress

DiagramToolboxRegistrator.RegisterStencil(DiagramStencil) Method

corelibraries-devexpress-dot-diagram-dot-core-dot-diagramtoolboxregistrator-dot-registerstencil-x28-devexpress-dot-diagram-dot-core-dot-diagramstencil-x29.md

latest6.9 KB
Original Source

DiagramToolboxRegistrator.RegisterStencil(DiagramStencil) Method

Adds the specified stencil to the Shapes Panel.

Namespace : DevExpress.Diagram.Core

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

NuGet Package : DevExpress.Diagram.Core

Declaration

csharp
public static void RegisterStencil(
    DiagramStencil stencil
)
vb
Public Shared Sub RegisterStencil(
    stencil As DiagramStencil
)

Parameters

NameTypeDescription
stencilDiagramStencil

A DiagramStencil object that is the stencil to register.

|

Remarks

Use the DiagramStencil.Create method to create a new stencil.

See the examples:

The following code snippets (auto-collected from DevExpress Examples) contain references to the RegisterStencil(DiagramStencil) method.

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-register-factoryitemtools-for-shapes/CS/WindowsFormsApp4/Form1.cs#L19

csharp
DiagramToolboxRegistrator.RegisterStencil(stencil);

wpf-diagram-register-factoryitemtools-for-shapes/CS/WpfApp13/MainWindow.xaml.cs#L19

csharp
DiagramToolboxRegistrator.RegisterStencil(stencil);

wpf-diagram-register-and-use-svg-shapes/CS/DiagramSVGItemsWpf/MainWindow.xaml.cs#L31

csharp
}
DevExpress.Diagram.Core.DiagramToolboxRegistrator.RegisterStencil(stencil);
diagramDesignerControl1.SelectedStencils.Add("SVGStencil");

winforms-diagram-create-custom-shapes-with-connection-points/CS/XtraDiagram.CreateCustomShapes/Form1.cs#L30

csharp
var stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", stream, shapeName => shapeName);
    DiagramToolboxRegistrator.RegisterStencil(stencil);
}

diagramcontrol-how-to-create-custom-shapes-with-connection-points-using-xaml-markup-t381372/CS/XtraDiagram.CreateCustomShapesXaml/Form1.cs#L30

csharp
var stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", shapesDictionary, shapeName => shapeName);
    DiagramToolboxRegistrator.RegisterStencil(stencil);
}

winforms-diagram-register-factoryitemtools-for-shapes/VB/WindowsFormsApp4/Form1.vb#L21

vb
FactoryItemToolForCustomShape(stencil)
DiagramToolboxRegistrator.RegisterStencil(stencil)
diagramControl1.OptionsBehavior.SelectedStencils = New StencilCollection() From {"CustomStencil"}

wpf-diagram-register-factoryitemtools-for-shapes/VB/WpfApp13/MainWindow.xaml.vb#L21

vb
FactoryItemToolForCustomShape(stencil)
DiagramToolboxRegistrator.RegisterStencil(stencil)
Me.diagramControl1.SelectedStencils = New StencilCollection() From {"CustomStencil"}

wpf-diagram-register-and-use-svg-shapes/VB/DiagramSVGItemsWpf/MainWindow.xaml.vb#L50

vb
Next file
DevExpress.Diagram.Core.DiagramToolboxRegistrator.RegisterStencil(stencil)
diagramDesignerControl1.SelectedStencils.Add("SVGStencil")

winforms-diagram-create-custom-shapes-with-connection-points/VB/XtraDiagram.CreateCustomShapes/Form1.vb#L32

vb
Dim stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", stream, Function(shapeName) shapeName)
    DiagramToolboxRegistrator.RegisterStencil(stencil)
End Using

diagramcontrol-how-to-create-custom-shapes-with-connection-points-using-xaml-markup-t381372/VB/XtraDiagram.CreateCustomShapesXaml/Form1.vb#L30

vb
Dim stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", shapesDictionary, Function(shapeName) shapeName)
    DiagramToolboxRegistrator.RegisterStencil(stencil)
End Sub

See Also

DiagramToolboxRegistrator Class

DiagramToolboxRegistrator Members

DevExpress.Diagram.Core Namespace