Is validation called before or after enforcement when setting DependencyProperty?

I created a simple class with DependencyProperty. When setting the value, I see that ValidateValueCallback is called before CoerceValueCallback.

The wpftutorial and other books indicate that coercion is called before verification.

+3
source share
2 answers

3.5sp1 is here.

MSDN seems to imply that validation occurs before enforcement. This matches what you find.

, ValidateValueCallback - CoerceValueCallback. Reflector , , .

. , .

Edit:

-, CoerceValueCallback, ValidateValueCallback . --Validate.

+2

, . , . , . / , . "", "".

, / , , . , "".

+2

Source: https://habr.com/ru/post/1698153/


All Articles