【发布时间】:2012-04-20 22:45:40
【问题描述】:
以下代码在编译时工作正常,但我无法让 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不是绑定。
标签: wpf xaml data-binding binding