switch ("Case2")
{
case (string)Application.Current.FindResource("Case1");
//Do Some logic
break;
case (string)Application.Current.FindResource("Case2");
//Do Some logic
break;
case (string)Application.Current.FindResource("Case3");
//Do Some logic
break;
default:
break;
}
我做了这段代码,但它不起作用。现在我想将从资源字典中获取的字符串值((string)Application.Current.FindResource("Case1"))分配给常量表达式。这怎么可能,否则有什么办法吗?