Anchored or moored 'diversions' aside, the earlier you can get your kids actively involved in actually sailing the boat the better.
Even a 3 year old can "help" you steer... they can 'tail' a self tailing winch for you, look for nav aids with their own binoculars, help pull on sheets etc.
On long quiet trips with less activity, encourage reading as opposed to game boys and texting. There are plenty of stories based on sea faring kids (Swallows and Amazons, the Enid Blyton's Adventure series, etc that are great reads and entertaining for all ages)
Once they are 6, 7 or older then the sailing pram comes into play - they get some independence and self confidence, just pick the right location and conditions.
Before you know it they'll be egging you on to "catch that guy over there"!...