下面的代码在编译时工作正常,但我无法获得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>
'x:Static'是*不是*绑定。 – 2012-04-21 01:14:56