It happens that I define a ResourceDictionary
for the app colors to use it in XAML files, and have a static class for these colors to use in the cs code:
for example:
<ResourceDictionary
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.Themes.AppTheme">
<Color x:Key="BrandColor">#ffd92e</Color>
<Color x:Key="BgColor">#343433</Color>
</ResourceDictionary>
And the opposite class:
public static class AppColors
{
public static readonly Color BrandColor = (Color)Application.Current.Resources["BrandColor"];
public static readonly Color BGColor = (Color)Application.Current.Resources["BgColor"];
}
Another scenario,I use icons font in both xaml and cs,
in XAML it looks like 
, and in cs it's: \ue8d5
. I want to save them in a file where I can reference them by a meaningful names in XAML and cs like:
IconBell = \ue8d5
Is it possible to define resources like those in one place and use them in both XAML and code?