@Yovi:  The code should go into a WaveGesture class instead of just straight into your MainWindow class.  I think you'll find that the compile issues go away if you do this.