![](/img/trans.png)
[英]Silverlight Project Advice - Sharing resources between projects in Solution/Projects
[英]Sharing ResourceDicrionary between two projects
我有一個具有以下結構的 UWP 應用程序:
MyAwesomeApp.sln
Common.csproj
Resources.xaml
Main.csproj (startup project)
MainPage.xaml
MainPage.xaml.cs
App.xaml
App.xaml.cs
OtherProjects...
我可以在App.xaml
或MainPage.xaml
中使用Resources.xaml
嗎?
這取決於Common
的項目類型。 如果它是“類庫(通用 Windows)”或“Windows 運行時組件”項目,那么您可以直接訪問資源文件,例如:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Common/Dictionary1.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
如果它不是“類庫(通用 Windows)”或“Windows 運行時組件”項目,那么您不能這樣做。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.