45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
using Gallery.Resources.UI;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Gallery.Resources.Theme
|
|
{
|
|
public abstract class Theme : ResourceDictionary
|
|
{
|
|
public const string StatusBarStyle = nameof(StatusBarStyle);
|
|
public const string NavigationColor = nameof(NavigationColor);
|
|
|
|
public const string IconLightFamily = nameof(IconLightFamily);
|
|
public const string IconRegularFamily = nameof(IconRegularFamily);
|
|
public const string IconSolidFamily = nameof(IconSolidFamily);
|
|
public const string ScreenBottomPadding = nameof(ScreenBottomPadding);
|
|
|
|
public const string IconClose = nameof(IconClose);
|
|
public const string FontIconRefresh = nameof(FontIconRefresh);
|
|
|
|
public const string Primary = nameof(Primary);
|
|
|
|
protected void InitResources()
|
|
{
|
|
Add(IconLightFamily, Definition.IconLightFamily);
|
|
Add(IconRegularFamily, Definition.IconRegularFamily);
|
|
Add(IconSolidFamily, Definition.IconSolidFamily);
|
|
Add(ScreenBottomPadding, Definition.ScreenBottomPadding);
|
|
|
|
Add(FontIconRefresh, GetFontIcon(Definition.IconRefresh, Definition.IconSolidFamily));
|
|
|
|
Add(IconClose, Definition.IconClose);
|
|
}
|
|
|
|
private FontImageSource GetFontIcon(string icon, string family, Color color = default)
|
|
{
|
|
return new FontImageSource
|
|
{
|
|
FontFamily = family,
|
|
Glyph = icon,
|
|
Size = Definition.FontSizeTitle,
|
|
Color = color
|
|
};
|
|
}
|
|
}
|
|
}
|