Solved
I have realised why I had a problem.
I could not see the Click event
This was because I was not explicit enought in my class declaration:
I put
public class StateButton : Button
obviously picked the wrong button
public class StateButton : System.Windows.Controls.Button
This works
Then I just override the event