From 825599549aa5f53def3176083c99f1eb2dbd588e Mon Sep 17 00:00:00 2001 From: Dennis Daume Date: Wed, 18 Jun 2014 18:54:38 +0200 Subject: [PATCH] Move that into the subscribe --- Espera/Espera.View/Views/ShellView.xaml.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Espera/Espera.View/Views/ShellView.xaml.cs b/Espera/Espera.View/Views/ShellView.xaml.cs index bee71604..6a15ddbe 100644 --- a/Espera/Espera.View/Views/ShellView.xaml.cs +++ b/Espera/Espera.View/Views/ShellView.xaml.cs @@ -330,18 +330,14 @@ private void WireDragAndDrop() // Local songs and YouTube songs this.PlaylistListBox.ItemContainerStyle.RegisterEventSetter(DropEvent, x => new DragEventHandler(x)) .Where(x => x.Item2.Data.GetDataPresent(DataFormats.StringFormat) && (string)x.Item2.Data.GetData(DataFormats.StringFormat) == songSourceFormat) - .Select(x => + .Subscribe(x => { var target = (PlaylistEntryViewModel)((ListBoxItem)(x.Item1)).DataContext; - return target.Index; - }) - .Subscribe(targetIndex => - { var addCommand = this.shellViewModel.CurrentSongSource.AddToPlaylistCommand; if (addCommand.CanExecute(null)) { - addCommand.Execute(targetIndex); + addCommand.Execute(target.Index); } });