Esempio n. 1
0
        public ChordsPage(MainWindow mWindow)
        {
            InitializeComponent();
            this.mWindow = mWindow;
            connection   = new ConnectedClass();
            connection.SelectSongs();
            songsList = connection.songsList;
            songListBox.ItemsSource = songsList.Keys;
            string imagePath = $"../Pictures/Unfavorite.png";
            Uri    imageUri  = new Uri(imagePath, UriKind.RelativeOrAbsolute);

            favoriteImage.Source  = new BitmapImage(imageUri);
            currentSongIsFavorite = false;
        }
Esempio n. 2
0
 private void delSongButton_Click(object sender, RoutedEventArgs e)
 {
     if (songListBox.SelectedItem != null)
     {
         string songName = songListBox.SelectedItem.ToString();
         connection.DeleteSong(songName);
         connection.SelectSongs();
         songsList = connection.songsList;
         songListBox.ItemsSource = songsList.Keys;
         songText.Text           = "";
     }
     else
     {
         MessageBox.Show("Не выбрана песня");
     }
 }