Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Return the package name of a Windows 10 app
using BooksLib.Services;
using System;
using Windows.ApplicationModel;
namespace DesktopBridgeSample.Services
{
public class PackageNameService : IPackageNameService
{
public (string name, string id) GetPackageName()
{
try
{
Package package = Package.Current;
return (package.DisplayName, package.Id.FullName);
}
catch (InvalidOperationException)
{
return ("no package", "");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment