i want to do something like this using C# :
if (i == 0)
{
button a = new button();
}
else
{
TextBlock a = new TextBlock();
}
mainpage.children.add(a);
But i get an error that
Error 1 The name 'a' does not exist in the current context
Any ideas ?
thank you in advance !