Simpler Dependency Properties?
I'm being used to create Dependency Properties for my custom controls. But i'm really tired of defining static fields, populating them in the constructors, coding the standard properties and later the events, plus casting and validating objects, all despite the help of copy & paste and code snippets.
So, the question is... is there any effort, initiative, crowd-petition, framework, tool, project or idea to make the creation of dependency开发者_JAVA技巧 properties EASIER?
Maybe a C# 5.0 pre CTP of "Compiler as Service" and "Meta-Programming" to define such complex WPF/Silverlight features. That would be so helpful!
There are several out of the box code snippets Visual Studio defines:
propdp[TAB]
Dependency property
propa[TAB]
Attached property
I use them all the time! :)
In VS2010 (not sure about 2008) you can use the built in code snippets: type propdp
and press Tab
twice to create a DependencyProperty definition.
精彩评论