Oooops ... I should also have said that my framework also uses the Winform conditional code test as well - not just for the WPF environment ...
#if defined PBWINFORM then
/*action*/
#else
/*action*/
#end if
FWIW: Winform has its own nuances vs Win32 - apart from WPF. :-(