public void Init() { AppItems.Clear(); string[] appsPath = Directory.GetDirectories(ConfigManager.GetInstance().ApplicationAppsDirectory); foreach (string path in appsPath) { bool exist = false; AppStoreItem appStoreItem = new AppStoreItem(); AppItem appItem = AppManager.GetInstance().LoadApp(path); foreach (var item in AppManager.GetInstance().AppItemList) { if (item.AppUID == appItem.AppUID) { exist = true; break; } } appStoreItem.AppUID = appItem.AppUID; appStoreItem.Icon = appItem.Icon; appStoreItem.Title = appItem.Name; if (exist) { appStoreItem.Status = "UnInstall"; } else { appStoreItem.Status = "Install"; } Application.Current.Dispatcher.BeginInvoke((Action) delegate { AppItems.Add(appStoreItem); }); } }
public VolumeControlPopup() { InitializeComponent(); AllowsTransparency = true; StaysOpen = false; Opened += (_, __) => { AccentPolicyLibrary.SetWindowBlur(this, isEnabled: true, enableBorders: false); AppItems.Focus(); }; }
public void Update() { PageItems.Clear(); foreach (var item in AppManager.GetInstance().PageList) { AppPageItem pageItem = new AppPageItem(); pageItem.Page = item.Key; pageItem.IsSelect = false; PageItems.Add(pageItem); } bool isExist = false; foreach (AppPageItem item in PageItems) { if (item.Page == SelectPage) { item.IsSelect = true; isExist = true; break; } } if (!isExist) { SelectPage = 0; foreach (AppPageItem item in PageItems) { if (item.Page == SelectPage) { item.IsSelect = true; break; } } } AppItems.Clear(); foreach (AppItem item in AppManager.GetInstance().AppItemList) { if (item.Page == SelectPage) { AppItems.Add(item); } } }
private void VolumeControlPopup_Opened(object sender, EventArgs e) { AccentPolicyLibrary.SetWindowBlur(this, isEnabled: true, enableBorders: false); AppItems.Focus(); }