private List <ApplicationInfo> getStoreApps() { List <ApplicationInfo> storeApps = new List <ApplicationInfo>(); if (!EnvironmentHelper.IsWindows8OrBetter || EnvironmentHelper.IsServerCore) { // Package management components are not available before Windows 8 or on Server Core installations // Just return an empty list return(storeApps); } // Fetch all store apps ManagedShell.UWPInterop.StoreAppHelper.AppList.FetchApps(); foreach (ManagedShell.UWPInterop.StoreApp app in ManagedShell.UWPInterop.StoreAppHelper.AppList) { ApplicationInfo ai = ApplicationInfo.FromStoreApp(app); if (ai.Name != "") { storeApps.Add(ai); } } return(storeApps); }
public void AddStoreApp(string appUserModelId, AppCategoryType categoryType) { var storeApp = ManagedShell.UWPInterop.StoreAppHelper.AppList.GetAppByAumid(appUserModelId); if (storeApp == null) { return; } ApplicationInfo ai = ApplicationInfo.FromStoreApp(storeApp); // add it if (!ReferenceEquals(ai, null)) { CategoryList.GetSpecialCategory(categoryType).Add(ai); Save(); } }