intellisense在我的其他已加载的项目中不显示任何资源,它显示我在当前项目中的资源,但在其他附加项目中显示其他资源。
<UserControl x:Class="SelectionPlus.UI.Data.SelectableListControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SelectionPlus.UI.Data"
mc:Ignorable="d"
x:Name="SelectableListUserControl"
d:DesignHeight="300" d:DesignWidth="300" SizeChanged="UserControl_SizeChanged">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources;Component/Resources/Colors.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources;Component/Resources/Fonts.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources;Component/Resources/Text.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources;Component/Resources/ToolBar.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="MainUserControl" TargetType="{x:Type ContentControl}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Margin" Value="2"/>
<Setter Property="Padding" Value="0 3 0 0"/>
<Setter Property="BorderThickness" Value="{StaticResource control.Border.Thickness}"/>
<Setter Property="BorderBrush">
<Setter.Value>
<SolidColorBrush Color="{StaticResource Normal.BR.Color}"/>
</Setter.Value>
</Setter>
...............
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<ContentControl Name="contentControl" Style="{StaticResource MainUserControl}"/>
</Grid>
</UserControl>
当我输入StaticResource时,它只显示了我的ResourceKey属性,而资源项目中没有我的资源,但当我复制粘贴资源密钥时,它在运行时显示或解决了如何将它们返回到我的intellisense中,再次感谢。
我发现了这个问题& 解决方法其原因是两个项目的目标框架工作不同,在资源dll文件中,目标.net是4.5.2,而在我的项目中是4.7.2,当我把4.5.2或4.7.2都做成4.5.2或4.7.2时,它的工作很好,资源可以在intellisense中显示出来。