1. Preheat over to 400 degrees. Coat a 9-inch deep dish pie plate or a 9x9 baking dish with cooking spray.
2. Put the sliced potatoes in a microwave safte dish,, cover and microwave on high for 10 minutes or until potato slices are just tender.
3. Meanwhile, put the whipped butter into a nonstick medium saucepan or skillet and melt over medium-high heat. Add the chopped onion and leeks and saute for about 4 minutes or until they're lighly golden. Turn off the heat and stir in the parsley, thyme, garlic, salt, pepper and the cup of whole milk until ingredients are blended.
4. Put the flour and 1 tbsp. of the milk into a 2-cup measure and stir witha fork to make a paste. Stir in the egg and the remaining tablespoon of milk,and beat with a fork to blend.
5. In a large mixing bowl, combine the potatoes, the milk and onion mixture from the saucepan, the flour and egg mixture and the Gruyere and Parmesan cheeses. Stir gently.
6. Spoon the mixture into the prepared baking dish and bake until golden brown (about 20 minutes).