I'm creating an About page for a Windows Runtime app targeting Windows Phone 8.1. On Windows 8.1 and Windows 10 UWP, it's all but trivial to display most of the basic information about an app by using an API called Windows.ApplicationModel.Package
.
But, for reasons beyond my comprehension, Windows.ApplicationModel.Package
is severely handicapped on Windows Phone. While things like Id
, InstallDate
and InstalledLocation
have been available since Windows Phone 8, DisplayName
, Description
and PublisherDisplayName
, the things users actually care about, are not. (The version information is present in Id
, which is something at least.)
Are there any other ways to access this information reliably on Windows Phone, save from reading and parsing the manifest XML myself, or worse, hardcoding the values? I'd really rather not have to resort to either of those.
I'm not sure that there is some API to get more details than what is available through the Package API but for the application display name and description, there is one trick that might help.
The content of those two strings can be localized. You need to declare them using the ms-resource: scheme in your manifest (say ms-resource:AppName for the application name) and then add the localized string to your strings resources.
This allows you to easily get the name and description from your code in addition to using a localized name/description for your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With