feat: page-based navigation shell + Tests page wizard
Replace the monolithic MainWindow with a SelectedPage-driven shell (Dashboard / Pump / Bench / Tests / Results / Settings). The Tests page gets the Plan -> Preconditions -> Running -> Done wizard from ui-structure.md \u00a74, backed by a 7-item precondition gate and shared sub-views (PhaseCardView / TestSectionView / GraphicIndicatorView) extracted from the now-deleted monolithic TestPanelView. New VMs / views: - Tests wizard: TestPreconditions, PhaseCard, GraphicIndicator, TestSection, TestPlan, TestRunning, TestDone - Dashboard panels: DashboardConnection, DashboardReadings, DashboardAlarms, InterlockBanner, ResultHistory - Pump / bench panels: PumpIdentificationPanel, PumpLiveData, UnlockPanel, BenchDriveControl, BenchReadings, RelayBank, TemperatureControl, DtcList, AuthGate - Dialogs: generic ConfirmDialog, UserManageDialog, UserPromptDialog Supporting changes: - IsOilPumpOn exposed on MainViewModel for precondition evaluation - RequiresAuth added to TestDefinition (XML round-trip) - BipStatusDefinition + CompletedTestRun models - ~35 new Test.* localization keys (en + es) - Settings moved from modal dialog to full page - Pause / Retry / Skip stubs in TestRunningView; full spec in docs/gap-test-running-controls.md for follow-up implementation - docs/ui-structure.md captures the wizard design Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
51
ViewModels/Dialogs/ConfirmDialogViewModel.cs
Normal file
51
ViewModels/Dialogs/ConfirmDialogViewModel.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace HC_APTBS.ViewModels.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic Yes/No (or Confirm/Cancel) modal dialog view-model.
|
||||
///
|
||||
/// <para>Reusable across abort-test, skip-phase, delete-pump, and any future
|
||||
/// binary decision prompt. Caller sets <see cref="Title"/>, <see cref="Message"/>,
|
||||
/// <see cref="ConfirmText"/>, <see cref="CancelText"/> before showing the dialog,
|
||||
/// then inspects <see cref="Accepted"/> after the dialog closes.</para>
|
||||
/// </summary>
|
||||
public sealed partial class ConfirmDialogViewModel : ObservableObject
|
||||
{
|
||||
/// <summary>Window title.</summary>
|
||||
[ObservableProperty] private string _title = string.Empty;
|
||||
|
||||
/// <summary>Body message — may be multi-line.</summary>
|
||||
[ObservableProperty] private string _message = string.Empty;
|
||||
|
||||
/// <summary>Text shown on the positive-action button (defaults to a localised "OK").</summary>
|
||||
[ObservableProperty] private string _confirmText = "OK";
|
||||
|
||||
/// <summary>Text shown on the cancel button (defaults to a localised "Cancel").</summary>
|
||||
[ObservableProperty] private string _cancelText = "Cancel";
|
||||
|
||||
/// <summary>True when the operator clicked <see cref="ConfirmText"/>; false on cancel/close.</summary>
|
||||
public bool Accepted { get; private set; }
|
||||
|
||||
/// <summary>Raised when the dialog should close itself.</summary>
|
||||
public event Action? RequestClose;
|
||||
|
||||
/// <summary>Accepts the prompt — sets <see cref="Accepted"/> to true and closes.</summary>
|
||||
[RelayCommand]
|
||||
private void Confirm()
|
||||
{
|
||||
Accepted = true;
|
||||
RequestClose?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>Cancels the prompt — leaves <see cref="Accepted"/> false and closes.</summary>
|
||||
[RelayCommand]
|
||||
private void Cancel()
|
||||
{
|
||||
Accepted = false;
|
||||
RequestClose?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user