private void SelectionChangedHandler(SelectionChangedCommandArgs selectionChangedCommandArgs) { if (isSelectionChangedHandlerEnabled) { if (selectionChangedCommandArgs != null) { if (selectionChangedCommandArgs.AddedItems != null) { foreach (DownloadItemViewModel selectedDownloadItem in selectionChangedCommandArgs.AddedItems.OfType <DownloadItemViewModel>()) { selectedDownloadItem.IsSelected = true; } } if (selectionChangedCommandArgs.RemovedItems != null) { foreach (DownloadItemViewModel unselectedDownloadItem in selectionChangedCommandArgs.RemovedItems.OfType <DownloadItemViewModel>()) { unselectedDownloadItem.IsSelected = false; } } } UpdateSelectionButtonStates(); UpdateSelectedDownloadLogs(); } }
protected override void OnSelectionChanged(SelectionChangedEventArgs e) { SelectedRows = SelectedItems; SelectionChangedCommandArgs selectionChangedCommandArgs = new SelectionChangedCommandArgs(e.AddedItems, e.RemovedItems); SelectionChangedCommand?.Execute(selectionChangedCommandArgs); base.OnSelectionChanged(e); }