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 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!

Upvotes: 1

Views: 233

Answers (2)

Dan Puzey
Dan Puzey

Reputation: 34200

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.

Upvotes: 1

Arcturus
Arcturus

Reputation: 27055

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! :)

Upvotes: 7

Related Questions