Got WPF version work

This commit is contained in:
Vova
2024-01-18 17:42:44 +02:00
parent df51ee3ad6
commit 10b4146772
64 changed files with 866 additions and 411 deletions
@@ -0,0 +1,36 @@
using CommunityToolkit.Mvvm.Input;
using System.Windows.Input;
using TV_Player.ViewModels;
namespace TV_Player
{
public class ProgramsGroupViewModel : ObservableViewModelBase
{
private List<GroupInfo> _programs;
public List<GroupInfo> Programs
{
get => _programs;
set => SetProperty(ref _programs, value);
}
public GroupInfo SelectedItem { get; set; }
public ICommand ItemSelectedCommand { get; }
public ProgramsGroupViewModel()
{
ItemSelectedCommand = new RelayCommand(OnItemSelected);
ProgramsData.Instance.GroupsInformation.Subscribe(x=>Programs = x);
}
private void OnItemSelected()
{
//var navigation = (INavigation)Application.Current.MainPage.Navigation;
var programListViewModel = new ProgramsListViewModel(SelectedItem);
var conrtrol = new ProgramsList();
TVPlayerViewModel.Instance.SetPageContext(conrtrol, programListViewModel);
}
}
}