4
可以说,我有两个类是这样的:如何从XAML中的静态成员引用属性?
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.
啊,!实际上,我不需要让Resource成为一个属性,因为它是静态的,但除此之外,这绝对是我需要的答案。谢谢! – gerrod 2011-02-02 02:26:38