Exemplo n.º 1
0
        /// <summary>
        /// New Album Button Action. Opens the New Album Dialogue, receives the album title and description from the user
        /// Then uses them to create a new Album instance. Saves changes in data.bin with serialization.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NewAlbum_Button_Click(object sender, RoutedEventArgs e)
        {
            NewDialog dialog = new NewDialog();

            dialog.ShowDialog();
            if (dialog.DialogResult == true)
            {
                albumManager.AddNewAlbum(new Album(dialog.GetAlbumName(), dialog.GetAlbumDescription()));
            }
        }
        /// <summary>
        /// Method to create a new album, opens the new album window and awaits dialogue result before saving the created album to the album manager instance.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void new_btn_Click(object sender, RoutedEventArgs e)
        {
            NewEditDialogue newEditDialogue = new NewEditDialogue();

            newEditDialogue.ShowDialog();
            if (newEditDialogue.DialogResult == true)
            {
                Album album = new Album(newEditDialogue.Album.AlbumTitle, newEditDialogue.Album.AlbumDescription);
                albumManager.AddNewAlbum(album);
                SerializationHelper.Serialize(albumManager);
            }
        }