Bunch of interaction updates for the calendar item control.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user