[UWP] Windows Universal App适用于资源。 [英] [UWP]Windows Universal App accèss to resources.

查看:60
本文介绍了[UWP] Windows Universal App适用于资源。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试为Windows应用商店部署应用程序。该应用程序有很多纹理文件,字体和我的代码访问和加载的其他自定义的东西。我当前的阻塞是我无法将此资源复制到Myapp / Resources /
类目录,以便我可以检索。

Hello, I am trying to deploy an application, for the windows store. The application, has a lot of texture files, fonts, and other custom things that my code accesses and loads. My current blockage is that I cannot copy this resources to Myapp/Resources/ kind of directory so I can retrieve.


  • 我该如何解决这个问题?
  • 是否支持?
  • 是否有我可以遵循的指南?

提前谢谢!

推荐答案

Hi  Michae_P_C,

Hi Michae_P_C,

欢迎
到开发通用Windows应用论坛!
  < span lang ="en-US"style ="font-family:Calibri; font-size:11.0pt">请使用   标记 
发布到此论坛时,谢谢!

在uwp中,我们可以将文件放在应用程序安装目录中并获取该文件通过以下代码,更多详细信息,您可以看到  文件访问权限

In uwp, we can put files in the Application install directory and get the file by the following codes, more details, you can see the File access permissions.

using Windows.Storage;            
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///file.txt"));

此外,我们可以使用XAML为我们的应用定义UI或资源,并从我们的应用中获取,请参阅

ResourceDictionary和XAML资源引用

Also, we can define the UI or resources for our app using XAML, and get it from our app, please refer to ResourceDictionary and XAML resource references.

此外,我们可以将UI的字符串资源放入资源文件中。然后,您可以从代码或标记中引用这些字符串。请参阅 
UI字符串放入资源

Besides, we can put string resources for our UI into resource files. You can then reference those strings from your code or markup. Have a refer to Put UI strings into resources.

祝你好运,

Breeze


这篇关于[UWP] Windows Universal App适用于资源。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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