I am currently trying to create a ResourceDictionary. I have 2 projects (The main project with App.xaml & MainPage.xaml and another project which contains only subpages) and want to define a ResourceDictionary with different styles for specific elements in my subpages. E.g. I have a ListView with some TextBlocks and Images and want every TextBlock to have the same style. How do I achieve that? Is it correct to save the ResourceDictionary in the main project and implement it in the App.xaml? If so, how can my subproject use these Resources?
Some more information on how my project looks like:
MainProject
MyResourceDictionary.XAML
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MainProject">
<Style x:Key="ListViewTextBlock" TargetType="TextBlock">
<Setter Property="FontSize" Value="24"/>
<Setter Property="Foreground" Value="White"/>
</Style>
</ResourceDictionary>
App.xaml
<Application.Resources>
<ResourceDictionary Source="ResourceDictionary/MyResourceDictionary.xaml"/>
</Application.Resources>
SubProject
MySubPage.xaml
<ListViewItem ...>
<Grid...>
<Grid.ColumnDefinitions.../>
<TextBlock Grid.Column="0" Style={?} Text="Give me style!"/>
<Image...>
</Grid>
</ListViewItem>