0
所以我在一個解決方案中有一個WPF項目和一個SharedProject。這個項目沒有引用Assembly'SharedProject1'
SharedProject有一個ResourceDictionary文件。我從我的WPF項目中引用了SharedProject。
但是當我嘗試引用ResourceDictionaryit給出了消息:「大會‘SharedProject1’不受此項目中引用」。
<Window x:Class="WPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ietstesten"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<ResourceDictionary Source="pack://application:,,,/SharedProject1;component/Dictionary1.xaml" />
</Window.Resources>
<Grid>
</Grid>
啊哈是真的,然後它工作,謝謝。 – user7998549