Resource dictionaries are accessible only inside the context they were declared, so if we intended to reference resources that are declared in one page context from another page they will not be found. So if we need global resources to be defined like the ones that comes with the framework we do it in App.xaml
<Application x:Class="MyNewApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" RequestedTheme="Dark"> <Application.Resources> <ResourceDictionary> <SolidColorBrush x:Key="ColorRed">Red</SolidColorBrush> </ResourceDictionary> </Application.Resources> </Application>
This way we can access ColorRed
color resource from anywere in our app. But wait, we don't want to infest that little file with all our app's resources! So we do MergedDictionaries