在Windows Phone的项目准入的ResourceDictionary从通用8.1应用程序的App.xaml中共享的项目

问题描述:

我创建一个通用的Windows应用程序8.1。在Windows Phone 8.1项目中我有一定的XAML文件作为ResourceDictionary中。
在共享文件夹我有两个项目的共同的App.xaml(的Windows和Windows Phone)。

I am creating a Windows Universal 8.1 app. In the Windows Phone 8.1 project inside I have a certain Xaml file as ResourceDictionary. In the Shared Folder I have the common App.xaml of the 2 projects (Windows and Windows Phone).

ResourceDictionary中的路径为:MyApp.WindowsPhone /资产/风格/ JumpList.xaml

Path of ResourceDictionary is: "MyApp.WindowsPhone/Assets/Styles/JumpList.xaml"

在App.xaml中我补充:

In App.xaml I add:

<ResourceDictionary>
   <ResourceDictionary.MergedDictionaries>
           <ResourceDictionary Source="MyApp.WindowsPhone/Assets/Styles/JumpList.xaml"/>
   </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>



但我得到:

But I am getting:

An error occured while finding the resource dictionary "MyApp.WindowsPhone/Assets/Styles/JumpList.xaml"

任何想法是错误的,我的道路?

Any idea what's wrong in my Path?

由于 MyApp的。 WindowsPhone的是你不需要指定它,你能说出它作为
的根文件夹&LT; ResourceDictionary中源=/资产/风格/ JumpList.xaml /方式> 结果
通常我们宣布一个新的文件夹命名样式,Assets文件夹是为了按照规范将图像文件内的样式

Since MyApp.WindowsPhone is the root folder you don't need to specify it you can state it as <ResourceDictionary Source="/Assets/Styles/JumpList.xaml"/>
Usually we declare styles inside a new folder named Styles as Assets folder is meant for adding image files according to norms.

<ResourceDictionary Source="/Styles/JumpList.xaml"/>