tags:

views:

34

answers:

1

I have a 2 silverlight projects

  • Dashboard (the main app)
  • Dashboard.Controls (user controls)

I have a UserControl in Dashboard.Controls called header which has a grid that references a style

<Grid Background="{StaticResource HeaderBackground}" Height="55">...</Grid>

I had declared this style in the Dashboard App.xaml (via a resource dictionary) but this isn;t visible to the control.

My question is where do I create the ResourceDictionary that holds HeaderBAckground so it is accessible to the UserControl?

+4  A: 

You say that you have a "style" in your App.xaml, but looking at the code you have pasted the Grid will be looking for a Brush. If it is indeed a Style that you want to reference, you should change the xaml to:

<Grid Style="{StaticResource HeaderBackground}" Height="55">...</Grid>

Apart from that, what you are trying to do should work. Post more info if this does not help.

Henrik Söderlund
Perfect - My propblem was I was trying to set Bakcground rather than Style!Thanks.
kouPhax