简体   繁体   English

附加属性以避免自定义控件

[英]Attached properties to avoid custom controls

I've heard about the possibility to use attached properties to avoid writing a custom control in WPF. 我听说过使用附加属性来避免在WPF中编写自定义控件的可能性。
Could you explain me how or address me to a tutorial? 你能解释一下如何或解决我的教程吗?
Thank you 谢谢

I found by myself the answer to my question: attached behaviors. 我自己找到了我的问题的答案:附加行为。 They are a way to extend the functionality of a control without writing a new one and are based on a specific use of attached properties. 它们是一种扩展控件功能而无需编写新控件的方法,它基于附加属性的特定用途。
I found two interesting articles and I attach them below for those of you who are interested in: 我发现了两篇有趣的文章,我将它们附在下面,供有兴趣的人使用:
Elad's WPF Blog Elad的WPF博客
Josh Smith's article 约什史密斯的文章

I definitely think that the answer you found yourself is valid but for additional info explaining the Attached property pattern (In plain English as I wasn't too thrilled with Josh Smith's Article). 我绝对认为你自己找到的答案是有效的,但是有关解释附属财产模式的其他信息(简单的英语,因为我对Josh Smith的文章并不太兴奋)。 Took 5 min to read this and it cleared things up for me quite a bit. 花了5分钟阅读这篇文章 ,它为我清理了很多东西。 Gave me the quick and dirty of it. 给我快速而肮脏的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM