Example #1
0
        private void SearchPageSongListLinkClick(object sender, RoutedEventArgs e)
        {
            SongInfoExpend cursong = ((FrameworkElement)(sender)).DataContext as SongInfoExpend;

            PlayListData PlayListData = null;

            if (cursong.Source.IndexOf("osuname_") == 0)
            {
                var f = cursong.Source.Remove(0, "osuname_".Length);
                PlayListData = MainWindow.CurMainWindowInstence.OsuData.FirstOrDefault(x => x.PlatListName == f);
            }
            else if (cursong.Source.IndexOf("netid_") == 0)
            {
                var f = cursong.Source.Remove(0, "netid_".Length);
                PlayListData = MainWindow.CurMainWindowInstence.NetCloudData.FirstOrDefault(x => {
                    if (x.PlayListId == f)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });
            }
            if (PlayListData == null)
            {
                return;
            }
            SongList.SetPlayListData(PlayListData);
            SongList.StartCmd.Enqueue("select_" + cursong.SongInfo.SongName);
            if (MainWindow.CurMainWindowInstence.frame.Source == null || MainWindow.CurMainWindowInstence.frame.Source.OriginalString != "SongList.xml")
            {
                MainWindow.CurMainWindowInstence.frame.Navigate(new Uri("SongList/SongList.xaml", UriKind.Relative));
            }
            else
            {
                MainWindow.CurMainWindowInstence.frame.Refresh();
            }
        }
        private void ArtTextBlockMouseDown(object sender, MouseButtonEventArgs e)
        {
            string art = ((dynamic)(((TextBlock)sender).DataContext)).ArtName;
            var    NavigationService = MainWindow.CurMainWindowInstence.frame;
            var    netcloud          = MainWindow.CurMainWindowInstence.NetCloudData.AsParallel().SelectMany(x => x.Songs).Where(x => art.IndexExistOfAny(x.SongInfo.GetSongArtists)).ToList();
            var    osu = MainWindow.CurMainWindowInstence.OsuData.AsParallel().SelectMany(x => x.Songs).Where(x => art.IndexExistOfAny(x.SongInfo.GetSongArtists)).ToList();

            netcloud.AddRange(osu);
            netcloud = netcloud.GroupBy(x => x.SongInfo.SongName).Select(x => x.First()).ToList();
            PlayListData pld = null;

            if (NavigationService.Content != null)
            {
                SongList Pr = NavigationService.Content as SongList;
                if (Pr != null)
                {
                    NavigationService.AddBackEntry(new PlayListJournalEntry(Pr.PLD, MainWindow.CurMainWindowInstence.ReplySongListPage, Pr.SongListListView.SelectedItem));
                }
            }
            pld = new PlayListData()
            {
                PlatListName = "艺术家:" + art, PlayListType = 5, Songs = netcloud
            };
            SongList.SetPlayListData(pld);
            Uri NextUri = new Uri("SongList/SongList.xaml", UriKind.Relative);

            if (NavigationService.Source == null || NavigationService.Source.OriginalString != "SongList/SongList.xaml")
            {
                NavigationService.Navigate(NextUri);
            }
            else
            {
                NavigationService.Refresh();
            }
            this.Close();
        }