feat: Implement Playlists and Programs Management
- Added PlaylistsGroupViewModel to manage playlists and selection. - Introduced ProgramsGroupViewModel for handling program groups and subscriptions. - Created ProgramsListViewModel to manage individual program listings. - Developed SettingsViewModel for user settings including playlist management. - Implemented TVPlayerViewModel as the main view model coordinating screens and data. - Added PlayerView for video playback with LibVLC integration. - Created XAML views for PlaylistsGroup, ProgramsGroup, ProgramsList, and Settings. - Added sample M3U playlist for testing. - Documented WPF build instructions and project structure in WPF-BUILD.md. - Configured global.json for .NET SDK versioning.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace TV_Player.AvaloniaApp.ViewModels;
|
||||
|
||||
public class PlaylistsGroupViewModel : TV_Player.ObservableViewModelBase
|
||||
{
|
||||
private List<GroupInfo> _programs = new();
|
||||
public List<GroupInfo> Programs
|
||||
{
|
||||
get => _programs;
|
||||
set => SetProperty(ref _programs, value);
|
||||
}
|
||||
|
||||
public ICommand SelectPlaylistCommand { get; }
|
||||
|
||||
public PlaylistsGroupViewModel()
|
||||
{
|
||||
SelectPlaylistCommand = new RelayCommand<GroupInfo>(OnItemSelected);
|
||||
Programs = TVPlayerViewModel.Instance.PlayListsData
|
||||
.Select(x => new GroupInfo { Name = x.Key, Count = 0 })
|
||||
.ToList();
|
||||
}
|
||||
|
||||
private void OnItemSelected(GroupInfo? group)
|
||||
{
|
||||
if (group == null)
|
||||
return;
|
||||
|
||||
TVPlayerViewModel.Instance.ShowProgramsGroupScreen(group.Name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user