views:

114

answers:

0

I haven't been able to find a simple, straightforward answer regarding this scenario, so I thought I'd try here.

In WPF, you can so something like this:

<Style x:Key="headerBlock" TargetType="{x:Type StackPanel}">

The idea here is to avoid setting the Style property on every TextBlock inside the StackPanel. Instead, I can set the StackPanel's Style to "headerBlock" and have every TextBlock take on the style specified above.

This won' work in Silverlight, however, because Styles do not have Resource properties. I'd rather not have to create a UserControl just to get this functionality, because I can see running into this same scenario many times in an app, and I don't want a ton of UserControls whose purpose is only to cascade styles.

Is there a way to accomplish something like the above in Silverlight 3?