private void PlayListAddAudio_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { //create a window for adding songs AddAudioWind NewWind = new AddAudioWind(); NewWind.Owner = Application.Current.MainWindow; this.Opacity = 0.2; NewWind.WindowStartupLocation = WindowStartupLocation.CenterOwner; NewWind.Index = playLists.IndexOf((sender as TextBlock).DataContext as PlayList); //transfer playlist data to a new window NewWind.ListOfAudio.ItemsSource = mainPL.AudioList.Where(x => playLists[NewWind.Index].AudioList.Count (s => s.DirectoryName == x.DirectoryName && s.Name == x.Name) == 0); // display only songs that are not in the playlist NewWind.Show(); }
private void PlayListAddAudio_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { //создаем окно добавления песен AddAudioWind NewWind = new AddAudioWind(); NewWind.Owner = Application.Current.MainWindow; this.Opacity = 0.2; NewWind.WindowStartupLocation = WindowStartupLocation.CenterOwner; NewWind.Index = playLists.IndexOf((sender as TextBlock).DataContext as PlayList); //передаем в новое окно данные плейлиста NewWind.ListOfAudio.ItemsSource = mainPL.AudioList.Where(x => playLists[NewWind.Index].AudioList.Count (s => s.DirectoryName == x.DirectoryName && s.Name == x.Name) == 0); // отображаем только песни, которых нет в плейлисте NewWind.Show(); }