I´m using this code:
canvas.Children.Add(rect);
Canvas.SetTop(rect, (100 - prof) + (j * height));
Canvas.SetLeft(rect, (100 + prof) + (k * widht));
to draw many rectangles inside a previous drawn rectangle that is inside a canvas.
I need to delete/clear this rectangles.
I´ve tried
canvas.Children.Remove(rect);
but this doesn´t delete the rectangles.
And using
canvas.Children.Clear();
delete all childrens inside canvas, and i want to delete only whats inside the big rectangle.
Is there a way to do do it without creating a little canvas inside the big rectangle and doing a .clear to it?
Thank you.