- Added AvaloniaPdfViewer NuGet package (0.0.2-pre) for PDF rendering
- Created ManualViewerWindow to display game manuals
- Created ManualViewerViewModel with title and file path binding
- Added ManualViewModel for managing manual items in the action bar
- Added LoadManuals() to GameActionBarViewModel to load available manuals
- Added manual button (📖) to GameActionBarView with dropdown for multiple manuals
- Manuals are detected from game media with MediaType.Manual
28 lines
636 B
C#
28 lines
636 B
C#
using System;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
namespace LANCommander.Launcher.Avalonia.ViewModels;
|
|
|
|
public partial class ManualViewerViewModel : ViewModelBase
|
|
{
|
|
[ObservableProperty]
|
|
private string _title = "Manual";
|
|
|
|
[ObservableProperty]
|
|
private string _filePath = string.Empty;
|
|
|
|
public Action? CloseAction { get; set; }
|
|
|
|
public ManualViewerViewModel(string title, string filePath)
|
|
{
|
|
Title = title;
|
|
FilePath = filePath;
|
|
}
|
|
|
|
[RelayCommand]
|
|
private void Close()
|
|
{
|
|
CloseAction?.Invoke();
|
|
}
|
|
}
|