I am developing a C# application and I am drawing two components programmatically. However, I would like to make them connected (using line) so that when I move one component, I can change the coordinates of another object.
For example: Suppose there are two squares on Canvas and they are connected using a line. When a move one square, I also want to change the coordinates of another square. So, another square will also seem like moving relative to first one.
I would really appreciate if someone could help me out in second part. I think it can be done using dependency properties but I wasn't able to find an example.