AppListEntry.AppUserModelId プロパティ

定義

この AppListEntryアプリケーション ユーザー モデル ID (AUMID) を取得します

public:
 property Platform::String ^ AppUserModelId { Platform::String ^ get(); };
winrt::hstring AppUserModelId();
public string AppUserModelId { get; }
var string = appListEntry.appUserModelId;
Public ReadOnly Property AppUserModelId As String

プロパティ値

String

Platform::String

winrt::hstring

アプリの ID を表す文字列。

Windows の要件

デバイス ファミリ
Windows 10 Fall Creators Update (10.0.16299.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v5.0 で導入)

// Find and activate the desired application (if present on this machine)
using namespace Windows.Management.Deployment;

async Task<bool> RunApplicationAsync(string aumid)
{
  var packageManager = new Windows.Management.Deployment.PackageManager();
  IEnumerable<Package> packages = packageManager.FindPackagesForUserWithPackageTypes(
      null, PackageTypes.Main | PackageTypes.Optional);

  foreach (Package package in packages)
  {
    IReadOnlyList<AppListEntry> entries = await package.GetAppListEntriesAsync();
    foreach (AppListEntry entry in entries)
    {
      if (String.Equals(entry.AppUserModelId, aumid, StringComparison.OrdinalIgnoreCase))
      {
        return await entry.LaunchAsync();
      }
    }
  }
  return false;
}

注釈

AUMID は、アプリケーションを識別するために使用できる永続化可能な値です。 これは、 パッケージ ファミリ名 + Package Relative Application ID (PRAID) に基づいています。

識別子 説明
パッケージ ファミリ名 Name + Publisher (appxmanifest.xml<Identity> で見つかった要素)。
PRAID Idappxmanifest.xml で見つかった の プロパティ Application (例: <Application Id="Foo"...>)。

AUMID はパッケージのバージョンまたはアーキテクチャに依存しないため、複数のバージョンまたはプラットフォーム間でアプリを識別するために使用できます。

適用対象