Files
IPTVplayer/TV Player WPF/ViewModels/MainViewModel.cs
T
2024-01-21 12:14:48 +02:00

41 lines
1.0 KiB
C#

using CommunityToolkit.Mvvm.Input;
using System.Windows.Controls;
using System.Windows.Input;
namespace TV_Player
{
public class MainViewModel : ObservableViewModelBase
{
private ContentControl _control;
public ContentControl Control
{
get => _control;
set => SetProperty(ref _control, value);
}
private bool _isTopPanelVisible;
public bool IsTopPanelVisible{
get => _isTopPanelVisible;
set => SetProperty(ref _isTopPanelVisible, value);
}
public Action ButtonBackAction { get; set; }
public ICommand BackCommand { get; }
public MainViewModel()
{
var vm = new ProgramsGroupViewModel();
var control = new ProgramsGroupGrid();
control.DataContext = vm;
Control = control;
BackCommand = new RelayCommand(OnButtonBackClick);
}
private void OnButtonBackClick()
{
ButtonBackAction?.Invoke();
}
}
}