在Windows Phone的项目准入的ResourceDictionary从通用8.1应用程序的App.xaml中共享的项目 [英] Access ResourceDictionary in Windows Phone project from Shared project in App.xaml of Universal 8.1 App

查看:154
本文介绍了在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的是你不需要指定它,你能说出它作为
的根文件夹< 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"/>

这篇关于在Windows Phone的项目准入的ResourceDictionary从通用8.1应用程序的App.xaml中共享的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆