For a DependencyProperty
, I set a value using DependencyObject.SetC开发者_StackOverflow社区urrentValue(property, value)
. How does one unset the value so that the property evaluates to the normal local value again?
Calling InvalidateProperty will force the value to be reevaluated, and it appears to ignore the "current" value, so it effectively will unset it.
I don't believe you can 'unset' the value; you simply 'reset' the value to the previously saved value. If you dont have that, then you're OOL... -- Tejs
I do not think there is a way to do that, either. This method changes the value rather than adding an override in the ladder of precedences. Just get the value and store it somewhere before you overwrite it.
精彩评论