Resizing controls on a canvas
I have a Silverlight (v3) application that users can drag controls (e.g. Shapes, Images) onto, change the fill colour, drag around etc
I am looking for the best method to allow the user to click on a control, give a visible indication that the control can be reiszed (e.g. display resize handles) and then handle the resizing.
I have played with a few ways of doing thi开发者_如何学Gos but I am not sure of the best way to make this as clean/generic as possible - ideally I would like to mark a control as resizable and then have common code implement this. I have tried 1) adding a ControlTemplate to a control and 2) handling the MouseLeftButtonDown event and adding a new rectangle which surrounds the object and then resizing the original control as this rectangle is resized.
Does anyone have experience of implementing this, some good code resources?
Have a look at this Resize Behavior
精彩评论