Skip to content
Discussion options

You must be logged in to vote

Found it. I need to refer to P as ClassWherePIsDefined.NameOfP.

Also I have to make sure that the static field is named NameOfPProperty with NameOfP being the name passed to DependencyProperty.Register. Otherwise compilation works fine, but it fails at runtime.

The documentation seems to suggest that DependencyProperty.RegisterAttached should be used to define P in that case, but it seems that DependencyProperty.Register works just as well.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by miloush
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant