Hello.
I'm developing a C# application and I have the following enum:
public enum TourismItemType : int
{
Destination = 1,
PointOfInterest = 2,
Content = 3
}
And I also have a int variable, and I want to check that variable to know it is equal to TourismItemType.Destination
, like this:
int tourismType;
if (int.TryParse(NavigationContext.QueryString.Values.First(), out tourismType))
{
switch (tourismType)
{
case TourismItemType.Destination:
ShowDestinationInfo();
break;
case TourismItemType.PointOfInterest:
ShowPointOfInterestInfo();
break;
}
}
But it throws an error.
How can I do that?
Thanks.