简体   繁体   English

如何在Windows Phone 8.1(Xamarin表单)中访问应用程序的显示名称

[英]How do you access the applications display name in windows phone 8.1 (Xamarin Forms)

I need to access the display name field stored in the Package.appxmanifest. 我需要访问存储在Package.appxmanifest中的显示名称字段。 I am developing in Xamarin Forms and am trying to access this from the windows phone 8.1 project through dependency injection. 我正在Xamarin Forms中进行开发,并尝试通过依赖项注入从Windows Phone 8.1项目访问此文件。

To make it a little bit more clear this is the field I am trying to retrieve: 为了更清楚一点,这是我尝试检索的字段:

Package.appxmanifest

When I try accessing information from the Package.Current I don't see any options for the display name. 当我尝试从Package.Current中访问信息时,显示名称没有任何选项。 I get the following options (none of these are the correct one): 我得到以下选项(这些都不是正确的):

Package.Current.Id

Does anyone have any ideas how I can access this information? 有谁知道我如何访问此信息?

It seems you can't, have a look at this page in the documentation . 看来您不可以查看文档中的此页面。 It has this remark; 它有这句话;

This property is only supported for Windows Store app. 仅Windows Store应用程序支持此属性。 If you call this property on an instance of a package that was created by any mechanism other than Package.Current, this property returns an empty string (""). 如果在由Package.Current以外的任何机制创建的包的实例上调用此属性,则此属性将返回一个空字符串(“”)。

I'm not sure if the Package.appxmanifest file is still in the app that is installed on the device, if so, you could try to read it manually and extract it from there. 我不确定Package.appxmanifest文件是否仍在设备上安装的应用程序中,如果是这样,则可以尝试手动读取它并从那里提取它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Xamarin Forms 中检测 Windows Phone 8.1 与 Windows Phone 上的 UWPapp - Detect Windows Phone 8.1 versus UWPapp on Windows Phone in Xamarin Forms 您如何对Windows Phone 8.1应用进行Beta测试 - how do you beta a windows phone 8.1 app 适用于Windows Phone(8.1和10)平台的Xamarin Forms中的滑动手势识别器 - Swipe gesture recognizer in Xamarin Forms for windows phone (8.1 & 10) platform 如何使用xamarin表格为Windows 8.1(无Silverlight)手机圆角矩形边缘 - How to round rectangle edges for a windows 8.1 (no silverlight) phone using xamarin forms 如何在Windows Phone 8.1中显示rtf? - How to display rtf in Windows Phone 8.1? 如何在Windows Phone 8.1中显示模式窗体 - How to display a Modal form in Windows Phone 8.1 如何显示Windows Phone 8.1的传递信息 - How to display passed information for Windows Phone 8.1 如何访问Windows Phone 8.1中的下载文件夹 - How to access downloads folder in windows phone 8.1 如何在Windows Phone 8.1中使用System.Windows.Forms? - How to use System.Windows.Forms in Windows Phone 8.1? 如何为Windows Phone 8.1(C#)绑定到usercontrol.resources中的复杂对象 - How do you bind to a complex object in usercontrol.resources for Windows Phone 8.1 (C#)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM