1e8e444376
- 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.
30 lines
612 B
C#
30 lines
612 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
using TV_Player.AvaloniaApp.ViewModels;
|
|
|
|
namespace TV_Player.AvaloniaApp;
|
|
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
KeyDown += OnKeyDown;
|
|
}
|
|
|
|
private void OnKeyDown(object? sender, KeyEventArgs e)
|
|
{
|
|
if (DataContext is not MainWindowViewModel viewModel)
|
|
return;
|
|
|
|
if (e.Key == Key.Escape)
|
|
{
|
|
viewModel.OnCloseAppButtonClick();
|
|
}
|
|
else if (e.Key == Key.Back)
|
|
{
|
|
viewModel.TriggerBack();
|
|
}
|
|
}
|
|
}
|