For a DependencyProperty
, I set a value using DependencyObject.SetCurrentValue(property, value)
. How does one unset the value so that the property evaluates to the normal local value again?
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.
Calling InvalidateProperty will force the value to be reevaluated, and it appears to ignore the "current" value, so it effectively will unset it.
SetCurrentValue
will not update the binding source. –
Buddha TwoWay
binding which updates source on every target property change. The revert will work with all source-to-target bindings however. –
Buddha 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.
© 2022 - 2024 — McMap. All rights reserved.