37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
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);
|
|
|
|
|
|
}
|
|
}
|
|
}
|