First slicing, then cooking, or the other way around?
With a gratin, the idea is that the vegetables (traditionally just potatoes) are sliced so thinly that they cook very easily in the cream/cooking liquid while retaining some texture. If you pre-cook the vegetables, they will just disintegrate into a mush during baking.