I have a custom template for an expander that is close to the code below. I had to change some of the code to take out custom classes, brushes, etc..
I can't help about Silverlight, but in the new WPF 4 it is TextElement rather than TextBlock