我想用C#做这样的事情:
if (i == 0) { button a = new button(); } else { TextBlock a = new TextBlock(); } mainpage.children.add(a);
但我得到一个错误
错误1当前上下文中不存在名称"a"
有任何想法吗 ?
先感谢您 !
c# variables if-statement
c# ×1
if-statement ×1
variables ×1