N
N
Nikolay Alekseev2020-03-14 09:28:26
Canvas
Nikolay Alekseev, 2020-03-14 09:28:26

How to bind child elements to Canvas?

Good day to all!

I got a forgotten project from the bins (and I think I understand why I abandoned it), the purpose of which is to make simple dialogues between characters for games.
The result looks like this:
5e6c7873a1fbb431291481.gif
Everything seems to work, but the only thing is that nodes are added to the canvas using the usual
canvas.Children.Add(node);
AND parallel saving of the same node to the list.

This approach not only violates the concept of mvvm, which I try to follow, but also corny complicates the architecture and it is very, very inconvenient to work this way.
For example, the coordinates of a node during dragging are read in the event of this very dragging, searching for the desired node in the list and writing them there.

Can you please tell me if it is possible to implement what I need using WPF binding tools?

Well, maybe I’m going the wrong way at all and such functionality can be implemented using something other than a canvas?

Thank you in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question