private async void OnFiltersUpdated(FilterUpdateMessage msg) { var toDelete = new List <StatusViewModel>(); foreach (var item in Items.OfType <StatusViewModel>()) { if (Muter.IsMuted(item.Model)) { toDelete.Add(item); } } msg.RemoveCount += toDelete.Count; await Dispatcher.RunAsync(() => toDelete.ForEach(it => Items.Remove(it))); }
public void SaveTo(IConfig config) { config.Mute.Entries.Clear(); config.Mute.Entries.AddRange(Entries); if (Changed) { var msg = new FilterUpdateMessage(); MessengerInstance.Send(msg); if (msg.RemoveCount > 0) { var str = string.Format(Strings.StatusesMuted, msg.RemoveCount); Notifier.DisplayMessage(str, NotificationType.Information); } } }