The shower is probably overheating due to reduced flow either because the pipes are clogged with limescale or reduced water pressure. The overheat switch is tripping and cutting off power to the solenoid the controls the water flow, and also turns off the heater.
Take valve apart and clear any debris in pipe, or limescale etc.
Check overheat switch for proper operation.
Hope this helps...
Chris, March 2005