Reputation: 191
Here is what I am trying to do:
public static partial class Const
{
public static class IconColors
{
public const Color IconBlue1 = Color.FromHex("007AFF");
}
}
But it gives me an error saying that the type Color cannot be declared const.
Does anyone have any suggestions / advice ?
Upvotes: 1
Views: 189
Reputation: 18861
You could define it like following
public class IconColors
{
public static Color IconBlue1 { get; } = Color.FromHex("007AFF");
}
And access it like
var color = IconColors.IconBlue1;
Upvotes: 1