Proper cleanup of account on the UI when its deleted.

This commit is contained in:
Burak Kaan Köse
2026-02-16 01:56:22 +01:00
parent 31a7faeef9
commit fec49ce6f8
6 changed files with 185 additions and 18 deletions
@@ -115,6 +115,18 @@ public class CalendarEventCollection
}
}
public void RemoveCalendarItems(Func<ICalendarItem, bool> predicate)
{
if (predicate == null) return;
var itemsToRemove = _allItems.Where(predicate).ToList();
foreach (var item in itemsToRemove)
{
RemoveCalendarItem(item);
}
}
private void AddCalendarItemInternal(ObservableRangeCollection<ICalendarItem> collection, ICalendarItem calendarItem, bool create = true)
{
if (calendarItem is not ICalendarItemViewModel viewModel)