Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unregistering properties created with DependencyProperty.RegisterAttached

After creating a DependencyProperty with DependencyProperty.RegisterAttached (MSDN link), is there any way to un-register them from the owner type?

like image 794
kpozin Avatar asked Nov 21 '25 07:11

kpozin


1 Answers

While there is technically a way, it's a particularly nasty piece of code that plays around with the internals of the DependencyProperty class. The author even noted that his method should not be used in production code.

With that being said, there is no framework-provided way to unregister a dependency property. And, as a side note, I'm not sure why you'd want to do such a thing in the first place.

like image 170
Adam Maras Avatar answered Nov 22 '25 20:11

Adam Maras



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!