是否可以通过ResourceDictionary
而不是相对路径引用“嵌套”x:Key
?
的App.xaml
<Application>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary x:Key="MyConstants" Source="Foo/Bar/MyConstants.xaml"/>
<!-- other stuff -->
</ResourceDictionary>
</Application.Resources>
</Application>
MainWindow.xaml
<Window.Resources>
<ResourceDictionary KeyReference="MyConstants"/>
</Window.Resources>