【发布时间】:2011-02-02 00:55:56
【问题描述】:
假设我有两个这样的类:
public class LocalResources
{
public Color ForegroundColor { get; set; }
}
public static class OrganisationModule
{
public static LocalResources Resources = new LocalResources
{
ForegroundColor = Color.FromRgb(32, 32, 32)
};
}
在 XAML 代码中,为什么我不能这样做(假设所有正确的 xml 命名空间都存在)?
<TextBlock Foreground="{x:Static Modules:OrganisationModule.Resources.ForegroundColor}" />
编译时出现错误:Cannot find the type 'OrganisationModule.ColorManager'. Note that type names are case sensitive.
【问题讨论】: