views:

91

answers:

1

I have a data-binding set on a dependency property of a class. I also have an IValueConverter to handle the calculation of this value based on other elements. The context of my question is inside the IValueConverter.Convert method.

#1
If the calculated return value is equal to the current property value, can I tell the framework not to bother with SetValue since there was no logical change? Or will the framework detect this automatically, and not waste time setting the property internally?

#2
If the calculated return value is invalid for this property, can I tell the framework to leave the property at its current value, rather than setting it to DependencyProperty.UnsetValue?

+3  A: 

See Binding.DoNothing.

HTH, Kent

Kent Boogaart