namespace Challenge
{
class Constss
{
public int score= 0;
}
}
I have a class which has public int type. And I am using it in MainPage.xml.cs class.
Constss c = new Constss();
c.score = 100;
When I want to use it in Step2 class, score value is again 0. How can I keep the value of score variable ?
I'm assuming you are instantiating two separate instances of Constss. This way, they are separate objects and will have their own (separate) values.
You can solve this a couple of ways: