When I declare a const from a resx I have a compilation error.
private const string ERROR_MESSAGE = MyResource.ResourceManager.GetString("resx_key");
Run Code Online (Sandbox Code Playgroud)
我明白为什么会出现此编译消息,但是有没有从资源声明 const 的技巧?
超级简单的问题,在WPF之前非常容易做到,现在我找不到简单的方法。
我正在寻找类似的东西:
foreach(var control in this.FrameworkElements)
{
control.IsEnabled = false;
}
Run Code Online (Sandbox Code Playgroud)