Bunch of interaction updates for the calendar item control.

This commit is contained in:
Burak Kaan Köse
2025-01-02 00:18:34 +01:00
parent 215dc6ea6d
commit 8a9265eb79
24 changed files with 333 additions and 102 deletions

View File

@@ -18,6 +18,11 @@ namespace Wino.Calendar.Services
public event EventHandler<GroupedAccountCalendarViewModel> CollectiveAccountGroupSelectionStateChanged;
public event EventHandler<AccountCalendarViewModel> AccountCalendarSelectionStateChanged;
[ObservableProperty]
public ObservableCollection<CalendarItemViewModel> _selectedItems = new ObservableCollection<CalendarItemViewModel>();
public bool HasMultipleSelectedItems => SelectedItems.Count > 1;
[ObservableProperty]
private ReadOnlyObservableCollection<GroupedAccountCalendarViewModel> groupedAccountCalendars;
@@ -47,6 +52,13 @@ namespace Wino.Calendar.Services
public AccountCalendarStateService()
{
GroupedAccountCalendars = new ReadOnlyObservableCollection<GroupedAccountCalendarViewModel>(_internalGroupedAccountCalendars);
SelectedItems.CollectionChanged += SelectedCalendarItemsUpdated;
}
private void SelectedCalendarItemsUpdated(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(nameof(HasMultipleSelectedItems));
}
private void SingleGroupCalendarCollectiveStateChanged(object sender, EventArgs e)