wpf custom control: draggable/resizable rectangle within another rectangle
I'm开发者_StackOverflow中文版 looking into a control with two rectangles: one inside the other. I want the user to be able to drag the inner rectangle, resize it and if possible rotate it as well within the bounds of the outer rectangle. The values should be bindable so I can store the values in my datasource when updated.
Are there already controls like this or does anyone have any suggestions?
I saw a codeproject article on dragging elements in a canvas but those properties aren't bindable..
This guy on CodeProject has a series of articles that do exactly what I think you're looking for. I expect the first article will be of most help to you, but the entire series is good.
1. Drag, resize, and rotate elements on a canvas
2. Designer Canvas with Zoombox
3. Connecting Items
4. A frankenbuild
This : Codeproject is something quite similar. If you can't find anything that suits you more then it is in my opinion a good base to start.
精彩评论