tags:

views:

13

answers:

2

I have two canvases.

Currently, when I drag a rectangle inside of the first canvas, it also moves the rectangle in the second canvas. I do this using TranslateTransform.

What I want to do is when I drag rectangle (A) to the left, rectangle (B) moves to the right, and vice versa etc.

Is there a relatively easy way to do this?

Chris

A: 

Would you be able to post some code as what you have already implemented if anything?

To do this I would simply apply an event to when the first rectangle moves (or is translated) to pass the transformation information to a method that translates the second rectangle with a negative value of x to make a "Reverse" transformation.

Blue
A: 

Easiest way would probably be to create a Converter which converts a value to its opposite (so positive to negative and vise versa). Apply it to the RenderTransform and bind it to the other Canvas TranslateTransform x/y values.

Rachel