[TUI] Add Image Help dialog with F1 shortcut for user assistance

This commit is contained in:
2025-10-16 21:20:20 +01:00
parent 8aca911c3d
commit c6fdc456fb
6 changed files with 130 additions and 1 deletions

View File

@@ -31,6 +31,8 @@ using System.Windows.Input;
using Aaru.CommonTypes;
using Aaru.CommonTypes.Interfaces;
using Aaru.Tui.Models;
using Aaru.Tui.ViewModels.Dialogs;
using Aaru.Tui.Views.Dialogs;
using Aaru.Tui.Views.Windows;
using Avalonia;
using Avalonia.Controls;
@@ -91,6 +93,7 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
ExitCommand = new RelayCommand(Exit);
BackCommand = new RelayCommand(Back);
HelpCommand = new AsyncRelayCommand(HelpAsync);
SectorViewCommand = new RelayCommand(SectorView);
}
@@ -146,6 +149,7 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
}
public ICommand BackCommand { get; }
public ICommand HelpCommand { get; }
public ICommand ExitCommand { get; }
public ICommand SectorViewCommand { get; }
@@ -178,6 +182,19 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
_ = Task.Run(Worker);
}
Task HelpAsync()
{
var dialog = new ImageHelpDialog
{
DataContext = new ImageHelpDialogViewModel(null!)
};
// Set the dialog reference after creation
((ImageHelpDialogViewModel)dialog.DataContext!)._dialog = dialog;
return dialog.ShowDialog(_view);
}
void Worker()
{
IsStatusVisible = true;