File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
WolvenKit.App/ViewModels/Dialogs
WolvenKit/Views/Dialogs/Windows Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -128,23 +128,19 @@ public void AddSongs(List<RadioSongItem> newItems)
128128
129129 public void RemoveSong ( RadioSongItem songItem )
130130 {
131- if ( ! SongItems . Select ( s => s . FilePath ) . ToList ( ) . Contains ( songItem . FilePath ) )
131+ var index = SongItems . FindIndex ( s => s . FilePath == songItem . FilePath ) ;
132+ if ( index == - 1 )
132133 {
133134 return ;
134135 }
135136
136- var songItems = SongItems . ToList ( ) ;
137- songItems . Remove ( songItem ) ;
138-
139- if ( songItems . FirstOrDefault ( f => f . Index > 0 ) is not null )
137+ SongItems . RemoveAt ( index ) ;
138+ for ( var i = index ; i < SongItems . Count ; i ++ )
140139 {
141- for ( var i = 0 ; i < songItems . Count ; i ++ )
142- {
143- songItems [ i ] . Index = i ;
144- }
140+ SongItems [ i ] . Index = i ;
145141 }
146142
147- SongItems = songItems ;
143+ SongItems = SongItems . ToList ( ) ;
148144 }
149145
150146 public void MoveSongOrder ( RadioSongItem ? songItem , int newIndex )
Original file line number Diff line number Diff line change 178178 IconPack =" Material"
179179 Kind =" DragVertical"
180180 Size =" {DynamicResource WolvenKitIconTiny}"
181+ Tag =" DragHandle"
181182 ToolTip =" Drag to reorder" />
182183 </DataTemplate >
183184 </syncfusion : GridTemplateColumn .CellTemplate>
You can’t perform that action at this time.
0 commit comments