像在设计器窗口中一样通过拖动调整圆形按钮的大小
我有一个圆形按钮,我想调整其大小(类似于在设计窗口中的操作方式)。如果这是一个矩形,我可以在边缘周围附加一些拇指或装饰器,并跟踪拖动增量并相应地更新大小。但是我该如何做一个圆圈,我想我可以在外部添加一个圆形拇指,当用户拖动它时我可以更新模板化父项的大小。还有其他方法可以解决这个问题吗?
I have a circular button, which I want to resize (similarly to how you do it in the design window). If this was a rectangle I can attach some thumbs or adorners around the edges and keep track of the drag delta and update the size correspondingly. But how do I do it for a circle, I guess I could add a circular thumb around the outside and when the user drags it I can update the size of the templated parent. Any other way to go about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个,但我自己没有尝试过:
http://denisvuyka.wordpress.com/ 2007/10/13/the-wpf-resizing-adorner-for-canvas/
Here's the one, I didn't try it myself though:
http://denisvuyka.wordpress.com/2007/10/13/the-wpf-resizing-adorner-for-canvas/
我必须承认这个问题有一个更优雅的解决方案,从技术角度来看它也更先进 - 即调整大小行为:
http://10rem.net/blog/2010/01/09/a-wpf-behavior-for-window-resize-events-in-net-35
I've to admit there's one more elegant solution for the problem, it's more advanced from a technology point of view too - namely a resize behavior:
http://10rem.net/blog/2010/01/09/a-wpf-behavior-for-window-resize-events-in-net-35