If you have a custom WPF attached property declared that you want to bind to in code, it’s very important to know that the paranthesis syntax won’t work.
For example, if you have a custom attached property AP defined by a class C, this doesn’t work:
Binding b = new Binding("(C.AP)");
Instead you need to do it this way:
Binding b = new Binding();
b.Path = new PropertyPath("(0)", C.APProperty); //using place holder and parameter
I found the solution above in an article on MSDN Forums, after a search of several hours. Microsoft didn’t say it in the MSDN documentation, at least in the data binding overview and related articles I’ve read.