If you are using a canvas, I'm assuming that you are using Canvas.X and Canvas.Y to position your rectangles.
The problem is that everytime you're modifying one of these properties the whole layouting is triggered.
A less expensive version would be to use a TranslateTransform as RenderTransform and just modifying the properties there. The benefit would be that if you move one of these rectangles it is moved with blitting which is a very cheap operation.
The problem is that everytime you're modifying one of these properties the whole layouting is triggered.
A less expensive version would be to use a TranslateTransform as RenderTransform and just modifying the properties there. The benefit would be that if you move one of these rectangles it is moved with blitting which is a very cheap operation.