corelibraries-devexpress-dot-diagram-dot-core-dot-diagramtoolboxregistrator-dot-registerstencil-x28-devexpress-dot-diagram-dot-core-dot-diagramstencil-x29.md
Adds the specified stencil to the Shapes Panel.
Namespace : DevExpress.Diagram.Core
Assembly : DevExpress.Diagram.v25.2.Core.dll
NuGet Package : DevExpress.Diagram.Core
public static void RegisterStencil(
DiagramStencil stencil
)
Public Shared Sub RegisterStencil(
stencil As DiagramStencil
)
| Name | Type | Description |
|---|---|---|
| stencil | DiagramStencil |
A DiagramStencil object that is the stencil to register.
|
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
DiagramToolboxRegistrator.RegisterStencil(stencil);
wpf-diagram-register-factoryitemtools-for-shapes/CS/WpfApp13/MainWindow.xaml.cs#L19
DiagramToolboxRegistrator.RegisterStencil(stencil);
wpf-diagram-register-and-use-svg-shapes/CS/DiagramSVGItemsWpf/MainWindow.xaml.cs#L31
}
DevExpress.Diagram.Core.DiagramToolboxRegistrator.RegisterStencil(stencil);
diagramDesignerControl1.SelectedStencils.Add("SVGStencil");
var stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", stream, shapeName => shapeName);
DiagramToolboxRegistrator.RegisterStencil(stencil);
}
var stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", shapesDictionary, shapeName => shapeName);
DiagramToolboxRegistrator.RegisterStencil(stencil);
}
winforms-diagram-register-factoryitemtools-for-shapes/VB/WindowsFormsApp4/Form1.vb#L21
FactoryItemToolForCustomShape(stencil)
DiagramToolboxRegistrator.RegisterStencil(stencil)
diagramControl1.OptionsBehavior.SelectedStencils = New StencilCollection() From {"CustomStencil"}
wpf-diagram-register-factoryitemtools-for-shapes/VB/WpfApp13/MainWindow.xaml.vb#L21
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
Next file
DevExpress.Diagram.Core.DiagramToolboxRegistrator.RegisterStencil(stencil)
diagramDesignerControl1.SelectedStencils.Add("SVGStencil")
Dim stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", stream, Function(shapeName) shapeName)
DiagramToolboxRegistrator.RegisterStencil(stencil)
End Using
Dim stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", shapesDictionary, Function(shapeName) shapeName)
DiagramToolboxRegistrator.RegisterStencil(stencil)
End Sub
See Also
DiagramToolboxRegistrator Class