Refactor wpf.class.php by NetBeans, revert if it's not fit ;-) #Xefir