Ejemplo n.º 1
0
        /// <summary>
        /// TODO Перерисовка кнопок альбомов
        /// </summary>
        /// <param name="albums">Набор альбомов</param>
        private void AlbumsButtonsRenderer(List <IAlbum> albums)
        {
            AlbumButtonPanel.Children.Clear();

            if (albums != null)
            {
                foreach (var item in albums)
                {
                    item.FolderAdded += Album_FolderAdded;

                    var def = new Forms.Albums.AlbumButton(item);
                    def.AlbumButtonClicked += AlbumButtonClicked;
                    AlbumButtonPanel.Children.Add(def);
                }
            }

            var addBtn = new Forms.Albums.NewAlbumButton(AlbumsManager);

            addBtn.AlbumAdded += AddBtn_AlbumAdded;
            AlbumButtonPanel.Children.Add(addBtn);

            AlbumsManager.Albums.First().IsCurrent = true;

            CurrentAlbum = AlbumsManager.Albums.First();

            (FavoriteStackPanel.Children[0] as Forms.Favorites.FolderButton).MainButton_Click(this, new RoutedEventArgs());
        }
Ejemplo n.º 2
0
 private void AddBtn_AlbumAdded(object sender, EventArgs e)
 {
     AlbumsButtonsRenderer(AlbumsManager.Albums);
     CurrentAlbum = sender as IAlbum;
 }
Ejemplo n.º 3
0
 private void AlbumButtonClicked(object sender, EventArgs e)
 {
     CurrentAlbum = sender as IAlbum;
 }