How to move the canvas by selecting an item?

I have a Canvas inside a scroolviewer with a large background (width and height are twice that of my screen). I put some shapes inside the canvas and I can select them from the list. When I select a shape from my list, the shape stands out.

The problem is that when I select a form that goes beyond the screen, I don’t see where it is, so I want to move the canvas camera to see it. I can explain this better with the image:

enter image description here

Here, if I select "shape 1" or "shape 2", I see that they are highlighted "because they are on the screen, but if I select 3, it will be highlighted, but I don’t see where it is ... I need to move the canvas to make view 3 visible ...

Thanks everyone!

+4
1

Shape 3, ScrollViewer BringIntoView :

UIElement shape3;

shape3.BringIntoView();
+4

All Articles