예제 #1
0
        private void AlbumArt_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var album = Itemsource.SongLibrary.ToList();

            if (_selectedSong != null)
            {
                var content = _selectedSong.Album;
                album = album.Where(x => x.Album == content).ToList();
            }
            SongGrid.ItemsSource = album;
            _currentView         = 1; // Set our view to songs grid

            //albumSorting.Background = Brushes.LightGray;
            AlbumSortingIcon.Fill        = (Brush)FindResource("AccentColorBrush");
            AlbumSortingLabel.Foreground = (Brush)FindResource("AccentColorBrush");

            SongSorting.ClearValue(BackgroundProperty);
            SongSortingIcon.Fill        = Brushes.LightGray;
            SongSortingLabel.Foreground = Brushes.LightGray;
            ArtistSorting.ClearValue(BackgroundProperty);
            ArtistSortingIcon.Fill        = Brushes.LightGray;
            ArtistSortingLabel.Foreground = Brushes.LightGray;

            ArtistsSelector.Visibility = Visibility.Hidden;
            AlbumsSelector.Visibility  = Visibility.Visible;
            SongsSelector.Visibility   = Visibility.Hidden;

            SongGrid.Visibility     = Visibility.Visible;
            ScrollViewer.Visibility = Visibility.Hidden;
            SearchBox.Visibility    = Visibility.Visible;
        }
예제 #2
0
        private void ArtistSorting_OnClick(object sender, RoutedEventArgs e)
        {
            if (_currentView != 2)
            {
                var watch = new Stopwatch();
                watch.Start();

                GrabArtists();
                _currentView = 2; // Set our view to artist grid
                GridSort("Artist", SongGrid);

                ArtistSortingIcon.Fill        = (Brush)FindResource("AccentColorBrush");
                ArtistSortingLabel.Foreground = (Brush)FindResource("AccentColorBrush");

                SongSorting.ClearValue(BackgroundProperty);
                SongSortingIcon.Fill        = Brushes.LightGray;
                SongSortingLabel.Foreground = Brushes.LightGray;
                AlbumSorting.ClearValue(BackgroundProperty);
                AlbumSortingIcon.Fill        = Brushes.LightGray;
                AlbumSortingLabel.Foreground = Brushes.LightGray;

                ArtistsSelector.Visibility = Visibility.Visible;
                AlbumsSelector.Visibility  = Visibility.Hidden;
                SongsSelector.Visibility   = Visibility.Hidden;

                SongGrid.Visibility     = Visibility.Hidden;
                ScrollViewer.Visibility = Visibility.Visible;
                SearchBox.Visibility    = Visibility.Collapsed;
                watch.Stop();
                Console.WriteLine(_artistCount + @" artists loaded in " + watch.ElapsedMilliseconds + @" milliseconds");
            }
        }