I have a quick question: I want to bind a Solidcolorbrush, which is located in App.xaml's Resources. It has a key assigned to it, but how would I bind to that property from another page?
Here is the App.xaml itself:
<Application x:Class="Mplayer.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<Color x:Key="PrimaryAccentColor" A="255" R="3" G="169" B="244"/>
<SolidColorBrush x:Key="PrimaryAccentBrush" Color="{StaticResource PrimaryAccentColor}"/>
<Color x:Key="SecondaryAccentColor" A="255" R="3" G="169" B="244"/>
<SolidColorBrush x:Key="SecondaryAccentBrush" Color="{StaticResource SecondaryAccentColor}"/>
<Color x:Key="LightBackgroundColor" A="255" R="3" G="169" B="244"/>
<SolidColorBrush x:Key="LightBackgroundBrush" Color="{StaticResource LightBackgroundColor}"/>
<Color x:Key="DarkBackgroundColor" A="255" R="3" G="169" B="244"/>
<SolidColorBrush x:Key="DarkBackgroundBrush" Color="{StaticResource DarkBackgroundColor}"/>
</ResourceDictionary>
</Application.Resources>
If I then have a page which I want to bind to the PrimaryAccentColorBrush
, how would that bind look?
I tried setting the bind to {Binding Path={StaticResource PrimaryAccentColorBrush}}
, but it did not locate it.
Any help would be appreciated =)