如何修复:此处不允许使用 XAML2009 语言构造? [英] How to fix: XAML2009 language construct is not allowed here?

查看:23
本文介绍了如何修复:此处不允许使用 XAML2009 语言构造?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 App.xaml 代码中,我有以下代码:

In my App.xaml code I have the following code:

<Application x:Class="PcgTools.App"
    ...
    <Application.Resources>
        <ResourceDictionary>
             ...
            <res:Strings x:FactoryMethod="res:StringResourceHelper.GetStringResources" 
             x:Key="LocStrings"/>
        </ResourceDictionary> 
    </Application.Resources>
</Application>

在使用 FactoryMethod 或 Attribute 构造之前,我从 VS2012 编译器收到一个错误.但现在我收到错误消息:此处不允许使用 Xaml2009 语言构造.

I got from the VS2012 compiler an error before to use the FactoryMethod or Attribute construct. But now I get the error: Xaml2009 language construct is not allowed here.

如何解决这个问题?

推荐答案

XAML 2009 不允许在已编译的 XAML 中(至少在 WPF 4.0 中不允许),请尝试将使用 2009 构造的内容移动到单独的资源字典文件中.

XAML 2009 is not allowed in compiled XAML (at least not in WPF 4.0), try to move your stuff that uses 2009 constructs to a separate Resource Dictionary file.

这篇关于如何修复:此处不允许使用 XAML2009 语言构造?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆