Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to reduce duplicate DependencyProperty code patterns

$
0
0

Hello,

I am coming from a DRY, SOLID type coding practice, and doing some WPF user-controls that require extensibility through DependencyProperty, and I have quickly found that the static-readonly DependencyProperty declaration, over, and over, and over, and over again, is very, extremely cumbersome.

I'm sure this is nothing new in the WPF / DependencyProperty discussion. I'd like to come up with a way of easily keeping track of DependencyProperty once it is created. I think it could be done looking already-registered ones, but I'm not sure there is an API other than DependencyProperty.Register to go to.

Probably then it's a matter of rolling my own dictionary and key on them somehow (?). What are the keys I should be aware of? The name and the declaring-Type, type thing?

Thank you...

Regards,

Michael Powell


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>