Implementing OOP based inheritance in State Machine

Creating a simple menu with multiple buttons requires a LOT of repetition and redundant button logic when the exact same enter and exit behaviour is being used on each button.

There should be some way to simplify this using OOP based inheritance.