12

在 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 在字符串中发现错误<ResourceDictionary Source="themes/...xaml"/> - 引发以下错误消息:应为 ResourceDictionary 的继承者。

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

4

2 回答 2

29

嗯。这是一个 BuildAction 问题。

I set up BuildAction property for xamls as Resource. And when I changed this property back to Page - erorrs are vanished.

于 2009-04-23T07:41:19.723 回答
0

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

替代文字 http://www.smips.com/brad/stackoverflow/so-109.jpg

于 2009-04-22T04:50:00.067 回答