Hi!
Quote:We will need to render a diagram and allow a user to create some basic primitives (lines, rectangles, text, arcs, etc) on it.
For lines you could use unconnected DiagramLink objects. E.g. set Diagram.AllowUnconnectedLinks = true and Diagram.Behavior = DrawLinks, then drawing with the mouse should create a standalone line-like DiagramLink. You might need to customize it to hide arrowheads.
For arc-like objects, check if unconnected links whose Shape is set to Spline or Bezier will work for you.
You could use ShapeNodes with Shape set to Rectangle to draw rectangles. Possibly set their Brush to Transparent if you don't need them filled.
You could show text using ShapeNodes whose Transparent property is enabled to hide the geometry and render only the Text property value.
If you prefer dedicated object types for these, you could derive from DiagramNode and implement rendering and interactions by overriding methods such as Draw, UpdateCreate, UpdateModify.
Quote:How easy it would be to "extend" the component and embed drawing tools like at draw.io?
You could create custom node types using Xaml templates as shown in tutorials 3&4, or by overriding Draw method as shown in e.g. IconNodes sample project.
You could show custom types in a NodeListView instance to create tool palettes as in draw.io. To enable drag-and-drop, you'd also have to implement serialization and cloning methods.
Quote:Another question. Is it possible to use the Skia library to render a diagram?
There's no built-in support for Skia. Maybe you could export the diagram to SVG using SvgExporter, and draw the SVG drawing in your Skia target using libraries such as
https://github.com/wieslawsoltes/Svg.SkiaRegards,
Slavcho
Mindfusion