Issue
Here's what I am doing right now:
public static class CONST
{
public static bool CarTmr = false;
Is this another way to do this that is more commonly used?
Solution
I'd go with the Microsoft recomended way
static class Constants
{
public const double Pi = 3.14159;
public const int SpeedOfLight = 300000; // km per sec.
}
// Accessible like
double area = Constants.Pi * (radius * radius);
So in your case:
public static class CONST
{
public const bool CarTmr = false;
}
Depending on the situation, you could also setup a class that reads from the configuration, if those constants relate to runtime and might be changed in the future.
There is no Xamarin
specific, better way to achieve it.
Answered By - Athanasios Kataras
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.