开发者

Using Silverlight User Controls and Styles from separate Project

I have a 2 silverlight projects

开发者_如何学Python
  • 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜