c# - Silverlight - Creating a canvas with auto-alignment and scale -


How do I create such canvas? I want to position each other very precise control, I want to help users to align properly by providing auto-alignment (like Visual Studio) and providing a scale to the user.

is the perfect container to use because you The situation of the child's control can create your problem is more about moving the elements around, which really drag & amp; drop down.

You have to handle mouse events: choose an item, MouseMove to locate MouseDown a drag and MouseUp For code> during step or drop to drop it, you can change the coordinates of the element to auto-align the grid or compare the surrounding elements.

I have successfully created such a project in Silverlight and to add resize handles to the Adorner S elements.

I solved the panning and zooming question by putting the canvas in a viewbox , which was a ScrollViewer If you want to control the zoom factor, then apply LayoutTransform to canvas (available in).


Comments