void HandleExitPopup(ButtonsPopupEvent message)
        {
            if (message.IsCanceled)
            {
                return;
            }

            if (message.SelectedButton == 2 && ValidateFields(true))
            {
                Song song = new Song();
                song.Artist         = Song.Artist;
                song.Author         = Song.Author;
                song.Title          = Song.Title;
                song.Sequences      = Song.Sequences;
                song.FilePath       = Song.FilePath;
                song.BackgroundPath = Song.BackgroundPath;
                song.CoverPath      = Song.CoverPath;
                song.CreateDate     = DateTime.Now;
                song.Duration       = Song.Duration;

                song.SaveToFile();
                _songsService.AddSong(song);

                _eventAggregator.Publish(new NavigationEvent()
                {
                    NavDestination = NavDestination.MainMenu
                });
            }

            if (message.SelectedButton == 3)
            {
                _eventAggregator.Publish(new NavigationEvent()
                {
                    NavDestination = NavDestination.MainMenu
                });
            }
        }
Ejemplo n.º 2
0
 public IActionResult AddSong(Song sng)
 {
     _songsService.AddSong(sng);
     return(RedirectToAction("Index", "Home"));
 }