Workaround for Windows.ApplicationModel.Package restrictions on Windows Phone?

I am creating an About page for a Windows Runtime application targeting Windows Phone 8.1. In Windows 8.1 and Windows 10, UWP is almost all trivial to display basic information about an application using an API called Windows.ApplicationModel.Package .

But for reasons beyond my understanding, Windows.ApplicationModel.Package very difficult on Windows Phone. Although things like Id , InstallDate and InstalledLocation were available with Windows Phone 8, DisplayName , Description and PublisherDisplayName , what really bothers users is not. (Version information is present in Id , at least.)

Are there any other ways to reliably access this information on Windows Phone, other than reading and analyzing the XML manifest itself, or, worse, hard-coded values? I really would not have to resort to any of them.

+8
c # windows-runtime
source share
1 answer

I'm not sure if there is some API to get more detailed information than what is available through the package API, but there is one trick for the display name and description of the application that can help.

The contents of these two lines can be localized. You need to declare them using the ms-resource: schema in your manifest (e.g. ms-resource: AppName for the application name), and then add the localized string to your string resources.

enter image description here

This makes it easy to get a name and description from your code in addition to using a localized name / description for your application.

+6
source share

All Articles