C#C
C#4y ago
yotabit

Color brush from App.xaml

App.xaml has a ResourceDictionary that contains a SolidColorBrush.

How can I get that SolidColorBrush from a different file .cs?

// App.xaml
<Application.Resources>
        <ResourceDictionary x:Name="AppResourceDic">
             <Color x:Key="Colors.MyOwnBlue">#002e5e</Color>
        <ResourceDictionary>
<Application.Resources>

//MyColors.cs
var color = App.AppResourceDic(Colors.MyOwnBlue); // <--- how??
Was this page helpful?