The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Please can you tell me how to add a symbol from the palette via code.
Ultimately, i want to populate a context menu (via right click mouse button) with each of the items from the palette and allow the user to add nodes from this.
The Help contains the following which i guess must be out of date:
How can I progammatically add a symbol from the palette?
The following code sample demonstrates how you can progamatically add a symbol from the symbol palette to a Diagram.
[C#]
//New InsertNodesCmd InsertNodesCmd insCmd = new InsertNodesCmd();
//Select the Symbol from the PaletteGroupView this.paletteGroupView1.SelectSymbolModel(this.paletteGroupView1.GroupViewItems[1].Text); SymbolModel symModel = this.paletteGroupView1.SelectedSymbolModel;
//New NodeCollection NodeCollection nodes = new NodeCollection();
//Add Symbol to the NodeCollection if (symModel != null) { Symbol triangle = symModel.CreateSymbol(); nodes.Add(triangle);
} insCmd.Nodes.Concat(nodes); insCmd.Location = new PointF(125,125); //ExecuteCommand to add the Symbol this.diagram1.Controller.ExecuteCommand(insCmd);