hi guys,
well, i'm new to C# and i have a conception problem.
I want to draw objects on a canvas and be able to move them.
To do this, i implemented a class, which has a function which returns the Shape of the object :
class Module {
// ... members, etc
public Shape getShape();
}
When i draw my object on canvas, i just basically do:
myCanvas.Children.Add( myObject->getShape() ) ;
This works. However, when i want to move my object, i can only have information to the Shape I drew but not the Object it bound to. I basicaly have an event on the canvas, which reacts when the mouse clicks the shape drawn:
private void myCanvas_MouseLeftButtonDown(object sender, MouseEventArgs e)
{
}
But there i have only access to the shape, part of the canvas children, but not the Module it is linked to.
How can i manage to have access to the object the shape is related to ? So i can move my objects.
If you have any advice ...
thank you!
cheers