Back to Devexpress

FactoryItemTool Class

corelibraries-devexpress-dot-diagram-dot-core-86e859d9.md

latest2.4 KB
Original Source

FactoryItemTool Class

Allows you to create custom item tools.

Namespace : DevExpress.Diagram.Core

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

NuGet Package : DevExpress.Diagram.Core

Declaration

csharp
public class FactoryItemTool :
    ItemTool
vb
Public Class FactoryItemTool
    Inherits ItemTool

Remarks

The example below illustrates how to create a custom rectangle and use it as the Ribbon’s Rectangle tool.

csharp
diagramControl1.OptionsBehavior.RectangleTool = new FactoryItemTool("CustomRect", () => "CustomRect",
    diagram => new DiagramShape() {
    Shape = BasicShapes.Rectangle,
    ConnectionPoints = new PointCollection(new List<PointFloat>() { new PointFloat(0.5F, 0.5F) })},
    BasicShapes.Rectangle.DefaultSize, BasicShapes.Rectangle.IsQuick);
vb
diagramControl1.OptionsBehavior.RectangleTool = New FactoryItemTool("CustomRect", Function() "CustomRect",
    Function(diagram) New DiagramShape() With {.Shape = BasicShapes.Rectangle,
    .ConnectionPoints = New PointCollection(New List(Of PointFloat)() From {New PointFloat(0.5F, 0.5F)})},
    BasicShapes.Rectangle.DefaultSize, BasicShapes.Rectangle.IsQuick)

To learn more, see the following examples:

Inheritance

Object DevExpress.Utils.ImmutableObject DiagramTool DevExpress.Diagram.Core.ItemTool FactoryItemTool

See Also

FactoryItemTool Members

DevExpress.Diagram.Core Namespace