Ejemplo n.º 1
0
        private void LibrarySelectionChanged(object sender, SelectionChangedEventArgs eventArgs)
        {
            if (LibraryListBox.SelectedIndex == -1)
            {
                return;
            }

            LibraryItemViewModel libraryItemViewModel = LibraryListBox.SelectedItem as LibraryItemViewModel;

            ILibraryItem libraryItem = libraryItemViewModel.LibraryItem;

            long itemId = libraryItem.Id;

            if (libraryItem.Type == LibraryItemType.Directory)
            {
                libraryHistory.Push(itemId);
                library.RequestItem(itemId);
            }
            else if (libraryItem.Type == LibraryItemType.Multimedia)
            {
                playlist.AddItem(itemId);
            }
        }