Hey DaneshBAria-
After testing I found that #ifdef / #ifndef do appear to work inside the source file without issue, there just seems to be an issue with using it in the header file. I entered a bug report for the #ifndef not having an affect on the UPROPERTY showing in the editor (UE-28516).
Cheers