Files
HC_APTBS/ViewModels/Dialogs/ProgressViewModel.cs
2026-04-11 12:45:18 +02:00

37 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using CommunityToolkit.Mvvm.ComponentModel;
namespace HC_APTBS.ViewModels.Dialogs
{
/// <summary>
/// ViewModel for the WProgressDisplay dialog.
///
/// <para>
/// Shows a progress bar (0100) and a verbose text line during long-running
/// K-Line operations. The dialog is closed by the parent when the operation
/// completes; this ViewModel simply exposes observable properties for binding.
/// </para>
/// </summary>
public sealed partial class ProgressViewModel : ObservableObject
{
/// <summary>Title text shown in the dialog's title bar.</summary>
[ObservableProperty] private string _title = string.Empty;
/// <summary>Current progress value (0100).</summary>
[ObservableProperty] private int _progressPercent;
/// <summary>Verbose status message describing the current step.</summary>
[ObservableProperty] private string _verboseMessage = string.Empty;
/// <summary>
/// Updates both <see cref="ProgressPercent"/> and <see cref="VerboseMessage"/>
/// in a single call. Thread-safe: may be called from any thread because
/// the consumer is expected to marshal to the UI thread before calling.
/// </summary>
public void Update(int percent, string message)
{
ProgressPercent = percent;
VerboseMessage = message;
}
}
}