While I was trying to create a sample for this problem I found my error, the second argument of the AutomationProperty should be a string ... - I have fixed my problem by changing the two lines :
AutomationProperty property = new AutomationProperty(prop, typeof(double?));
AutomationProperty property = new AutomationProperty(prop, typeof(string));
In my short sample, I got the following error :
Invalid cast from 'System.String' to 'System.Nullable`1[[System.Double, mscorlib, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.
This error is different from my previous Null Pointer exception, but both problems are fixed using typeof(string).
But I do not understand what the second parameter stands for, does anyone has an answer ?