private void RandomButt_Click(object sender, RoutedEventArgs e) { Random rand = new Random(); CurrentList = CurrentList.OrderBy(x => x != CurrentList[CurrentIndex] ? rand.Next() : 0).ToList(); //перемешиваем песни Play.ItemsSource = CurrentList; // обновляем список песен CurrentIndex = 0; //для воспроизведения с начала }
private void RandomButt_Click(object sender, RoutedEventArgs e) { Random rand = new Random(); CurrentList = CurrentList.OrderBy(x => x != CurrentList[CurrentIndex] ? rand.Next() : 0).ToList(); //mix songs Play.ItemsSource = CurrentList; // updating the list of songs CurrentIndex = 0; //to play from the beginning }
private void RandomButt_Click(object sender, RoutedEventArgs e) { Random rand = new Random(); CurrentList = CurrentList.OrderBy(x => x != CurrentList[CurrentIndex] ? rand.Next() : 0).ToList(); Play.ItemsSource = CurrentList; CurrentIndex = 0; }