以下代码在编译时工作正常,但我无法让Text="{x:Static local:SomeClass+Limits.Name}"在设计器中工作。在这方面的任何帮助将不胜感激!谢谢....
namespace StaticTest
{
public class SomeClass
{
public static class Limits
{
public const string Name = "It Works!";
}
}
}
<Window
x:Class="StaticTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:StaticTest"
Title="StaticTest"
Height="146"
Width="296"
WindowStartupLocation="CenterScreen">
<TextBlock
Grid.Column="1"
Grid.Row="1"
Text="{x:Static local:SomeClass+Limits.Name}" />
</Window>