I gave a presentation about Silverlight today at school. It went great and benefited me as well, as it took me away from all the wedding preparations and made me look at some old code and notes (well, some new too, I'm staying in the Cream's 'Light).
So, two things tonight. First, master pages. You probably have read Jesse Liberty's and Gerard Leblanc's articles - they're great and full of useful information, but I'll try simplifying things as much as possible.
Now, let's say you have your subpages as controls and you want to have a header/footer/sidebar.
- Start with a Grid layout, (Grid is the best one in general, more on that maybe someday), fill the right cells with that common header/footer/whatever.
- In the biggest cell, the one for subpages, place a ScrollViewer.
- Now, tell me, what is a ScrollViewer? A ContentControl. It means it has a Content property. It means it hosts a single control. What control could it be, hum?
- theScrollViewer.Content = theSubpage; - that's the whole navigation code!
I won't post any code here, just refer you to that article, my excuses being the lack of time and that the idea is not mine. As for translationg the idea into a working solution, I'm sure you'll do it easily.
Now we just need a way to handle the "back" button and the whole navigation history (thanks to one of today's listeners for bringing that up). However, my Silverlight sites don't go over 10 content pages, so tracking navigation history doesn't really have a point. And hey, it's Silverlight, it's super easy to do!