tags:

views:

465

answers:

1

Hi,

I have a Silverlight app with a canvas with some ellipes in it. I have another canvas below it with no elements.

What I want to do is, when I click in the first cancas, I want to copy the contents of the first canvas and zoom in where I clicked my mouse and show it in the second canvas.

I want functionality like Local Connection gives you in silverlight 3 but as the canvases are in the same xaml and app it would be overkill to use Local Connection.

A: 

My solution is really simple I'm almost embarrassed.

I have set the properties of my second canvas to match my first canvas and duplicated any static elements that wont change (I plan to try pull these from one xaml file)

When I click the first canvas I add a new ellipse at the point where I clicked. In the same function I create another ellipse element and add it to my second canvas.

cnvSource.Children.Add(ellipseElement);
cnvTarget.Children.Add(ellipseElementCopy);

I can then create a zoom function on my second canvas so that the first canvas is unafected.

skyfoot
I dont think my solution answers my question and is more of a work around. I would still like to know how to copy the entire contents of one Canvas to another canvas.
skyfoot