Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wpf custom control: draggable/resizable rectangle within another rectangle

Tags:

c#

wpf

I'm 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..

like image 200
internetmw Avatar asked Oct 25 '10 22:10

internetmw


2 Answers

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

like image 81
Saint Domino Avatar answered Nov 08 '22 04:11

Saint Domino


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.

like image 39
kubal5003 Avatar answered Nov 08 '22 05:11

kubal5003