initial commit
This commit is contained in:
36
ViewModels/Dialogs/ProgressViewModel.cs
Normal file
36
ViewModels/Dialogs/ProgressViewModel.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace HC_APTBS.ViewModels.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// ViewModel for the WProgressDisplay dialog.
|
||||
///
|
||||
/// <para>
|
||||
/// Shows a progress bar (0–100) 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 (0–100).</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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user