private async Task RemoveAnyTagsFromTagList(AppListViewCollection appList) { HashSet <FilterTag> allTags = appList.GetAllTagsAsSet(_ftEquality); if (allTags.IsProperSubsetOf(appList.Tags)) { await this.Dispatcher.InvokeAsync(() => { appList.Tags.Reset(allTags); }); string[] tagsAsStrings = appList.Tags.GetTagsAsStrings(); if (!Checked.IsSubsetOf(tagsAsStrings)) { Checked.IntersectWith(tagsAsStrings); } await this.Dispatcher.InvokeAsync(() => { appList.Tags.View.Refresh(); foreach (FilterTag ft in appList.Tags.Where(x => Checked.Contains(x.Tag))) { ft.IsChecked = true; } }); } }
internal AppListViewCollection Clone() { var col = new AppListViewCollection(this); foreach (SortDescription sd in this.View.SortDescriptions) { col.View.SortDescriptions.Add(sd); } return(col); }
private void Window_Loaded(object sender, RoutedEventArgs e) { this.IdentityBlock.Text = WindowsIdentity.GetCurrent().Name; App.MyHandle = new WindowInteropHelper(this).Handle; this.AppList = App.JsonSettings.Settings.Apps; Checked = new HashSet <string>(this.AppList.Tags.Count); this.AppListView.ItemsSource = this.AppList.View; this.FilterTags.ItemsSource = this.AppList.Tags.View; this.AppList.CollectionChanged += this.AppList_Changed; }