private void MatchPerformerToViewSource(PerformerItemData performerItem) { bool itemMatchFilter = _libraryViewData.CheckPerformersFilters(performerItem, DuplicatePerformersCheckBox.IsChecked == true, EmptyPerformersCheckBox.IsChecked == true); if (!itemMatchFilter) { PerformersView.Items.Remove(performerItem); } }
/// <summary> /// Checks current filters on a <see cref="AlbumArtistItemData"/> instance. /// </summary> /// <param name="performerItem"><see cref="PerformerItemData"/></param> /// <param name="checkDuplicates">Filters duplicates names.</param> /// <param name="checkEmpty">Filters invalid names.</param> /// <returns><c>True</c> if all filters apply; <c>False</c> otherwise.</returns> /// <exception cref="ArgumentNullException"><paramref name="performerItem"/> is <c>Null</c>.</exception> public bool CheckPerformersFilters(PerformerItemData performerItem, bool checkDuplicates, bool checkEmpty) { if (performerItem == null) { throw new ArgumentNullException(nameof(performerItem)); } return(ApplyFilters(new List <PerformerItemData> { performerItem }, checkDuplicates, checkEmpty ).Any()); }