VS 2013:XAML-Editor中的Intellisense不使用外部资源字典?

时间:2013-12-09 08:36:05

标签: c# wpf xaml intellisense visual-studio-2013

我最近安装了Visual Studio 2013。 Visual Studio的一项新功能是对XAML资源的Intellisense支持。似乎Intellisense仅适用于资源,资源直接在我的项目中定义。

我项目的App.xaml示例:

<Application.Resources>    
    <ResourceDictionary>
        <SolidColorBrush x:Key="someColor" Color="Black"/>
        <ResourceDictionary.MergedDictionaries>                
            <ResourceDictionary Source="/MyComponent;component/MyXamlResources.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

在我的项目的MainWindow.xaml中使用资源的示例:

<Window x:Class="XamlTest1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ctl="clr-namespace:MyComponent;assembly=MyComponent"
    Title="MainWindow" Height="350" Width="525"        
    Background="{StaticResource someColor}">    

正如您在App.xaml的代码片段中所看到的,有一种颜色直接定义了“someColor”键。此外,我指的是一个编译的DLL,它提供了更多的颜色定义。

在XAML-Editor中,Intellisense使用键“someColor”正常工作。我的问题是“MyComponent”/“MyXamlResources.xaml”中定义的所有颜色都不能与Intellisense一起使用,但我可以在我的项目中使用它们。

我的问题是,如果您正常使用此功能,并且您知道如何解决此问题。也许这是Visual Studio 2013中的一个错误?

非常感谢你的帮助。

0 个答案:

没有答案