How do views in Modules projects know about styles defined in the 'Shell' project ?

Topics: Prism v4 - WPF 4
Jul 24, 2012 at 3:24 PM
Edited Jul 24, 2012 at 3:24 PM

I am looking at the 'Stock Trader RI' desktop application.

I am trying to understand how, for example, the ArticleView.xaml window has this line:

 

<TextBlock Grid.Row="0" Text="NEWS ARTICLES" Style="{StaticResource TextBlockSectionTitle}" AutomationProperties.AutomationId="NewsArticleText" TextWrapping="Wrap" />

 

How does the ArticleView know about the style TextBlockSectionTitle ?

This style is defined in the 'styles.xaml' file of the StockTraderRI project, while the ArticleView.xaml file is part of the StockTraderRI.Modules.News project !

What am I missing here ?

Developer
Jul 24, 2012 at 5:22 PM

Hi,

Based on my understanding the ArticleView can access the TextBlockSectionTitle style, as this is defined as an Application Resource. These resources will be available to the entire application (including modules) and they are defined in the App.xaml file of the root project (in this case StockTraderRI project), where the Styles.xaml ResourceDictionary is merged.

I hope you find helpful,

Agustin Adami
http://blogs.southworks.net/aadami

Jul 25, 2012 at 10:17 PM
aadami wrote:

Hi,

Based on my understanding the ArticleView can access the TextBlockSectionTitle style, as this is defined as an Application Resource. These resources will be available to the entire application (including modules) and they are defined in the App.xaml file of the root project (in this case StockTraderRI project), where the Styles.xaml ResourceDictionary is merged.

I hope you find helpful,

Agustin Adami
http://blogs.southworks.net/aadami

Thanks, that made things clear ! :)