WPF自定义控件:另一个矩形内拖动/可调整大小的矩形 [英] wpf custom control: draggable/resizable rectangle within another rectangle

查看:1024
本文介绍了WPF自定义控件:另一个矩形内拖动/可调整大小的矩形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个C#WPF应用程序。我期待与两个矩形控制:在另一个内。我希望用户能够拖动内部矩形,调整其大小和如果可能的外矩形的界限内旋转它。该值应该是绑定所以更新的时候我可以存储在我的数据源中的值。

I'm working on a c# wpf app. 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?

我看到了一个CodeProject上的文章在画布上拖动的元素,但这些属性不绑定..

I saw a codeproject article on dragging elements in a canvas but those properties aren't bindable..

谢谢,

推荐答案

在CodeProject 这家伙有一系列做什么我想你要找的文章。我想到的第一篇文章将是最对您有所帮助,但整个系列还是不错的。

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。拖动,缩放和旋转在Canvas元素

2。设计师帆布配Zoombox

3。连接项

4。一个frankenbuild

这篇关于WPF自定义控件:另一个矩形内拖动/可调整大小的矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆