如何在 windows phone 8.1 (Xamarin Forms) 中访问应用程序显示名称

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

我需要访问存储在 Package.appxmanifest 中的显示名称字段。我正在 Xamarin Forms 中开发,并试图通过依赖注入从 windows phone 8.1 项目访问它。

为了更清楚一点,这是我要检索的字段:

当我尝试从 Package.Current 访问信息时,我没有看到显示名称的任何选项。我得到以下选项(其中 none 个是正确的):

有人知道我如何访问这些信息吗?

看来你不能,看看 documentation 中的这个页面。有这个备注;

This property is only supported for Windows Store app. 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.appxmanifest 文件是否仍在设备上安装的应用程序中,如果是,您可以尝试手动读取它并从那里提取它。