private void PlaylistCanvas_SelectionChanged(object sender, NotifyCollectionChangedEventArgs e) { PlaylistViewModel vm = (PlaylistViewModel)DataContext; switch (e.Action) { case NotifyCollectionChangedAction.Add: vm.SelectItems(e.NewItems); break; case NotifyCollectionChangedAction.Remove: vm.DeselectItems(e.OldItems); break; case NotifyCollectionChangedAction.Reset: vm.ClearSelection(); break; } }