I'm trying to create a WPF Shape (PolyLine) editor, which is a control that I want to use to, edit shapes in a canvas.
What the editor needs to do is to be able to display the points and lines of the shape and to move those around.
Can anyone provide me with a idea of how I can accomplish this, or a starting point? I haven't found anything related to how I could do this, so far.
There is good series of texts about this on CodeProject
WPF Diagram Designer - Part 1
WPF Diagram Designer - Part 2
WPF Diagram Designer - Part 3
WPF Diagram Designer - Part 4
I also liked the WPF DrawTools article on CodeProject, which has a very nicely formatted set of source classes. It provides a simpler example of outline shapes - ellipse, rectangle, line, polyline and text. Unfortunately, it was deleted in 2015, as someone just pointed out to me.
A copy of the article is available through the Wayback Machine but the linked source code has been deleted along with the original article. The article includes class diagrams and enough detail to give you a good idea of the overall design.
Nowadays I think it's worth looking at Kimono Designer, although it seems to have been announced to a lot of excitement and the code hasn't been updated for a year. Note there is a WPF port, as discussed in this article and sample on GitHub.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With