【问题标题】:"Inheritor of the ResourceDictionary is expected" - What does this error mean“应为 ResourceDictionary 的继承者” - 此错误是什么意思
【发布时间】:2009-04-18 16:30:39
【问题描述】:

在 App.xaml 我有以下代码:

<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="FJW.App">
    <Application.Resources>
        <!-- Resources scoped at the Application level should be defined here. -->
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="themes/F4.xaml"/>
                <ResourceDictionary Source="themes/F3.xaml"/>
                <ResourceDictionary Source="themes/F2.xaml"/>
                <ResourceDictionary Source="themes/F0.xaml"/>
                <ResourceDictionary Source="themes/F1.xaml"/>
                <ResourceDictionary Source="themes/Palm.xaml"/>
                <ResourceDictionary Source="themes/Key.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

Visual Studio 在字符串&lt;ResourceDictionary Source="themes/...xaml"/&gt; 中发现错误 - 引发以下错误消息:应为 ResourceDictionary 的继承者。

但是该项目正在正确编译并且工作正常。错误信息是什么意思?也许这是这个 Beta Silverlight 版本的错误?还是我的错?

【问题讨论】:

    标签: silverlight silverlight-3.0


    【解决方案1】:

    嗯。这是一个 BuildAction 问题。

    我将 xamls 的 BuildAction 属性设置为资源。当我将此属性改回 Page 时,错误就消失了。

    【讨论】:

    【解决方案2】:

    会不会是那些 .xaml 文件中的某个东西让您着迷?我将您的代码复制到一个新项目中,并且在 Visual Studio 或 Expression Blend 中都没有看到任何错误消息。

    alt text http://www.smips.com/brad/stackoverflow/so-109.jpg

    【讨论】:

    • 我认为不能。因为当我在主题文件夹中只留下一个 xaml 时 - 没有错误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-13
    相关资源
    最近更新 更多