29 lines
1.7 KiB
Markdown
29 lines
1.7 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.Common/BusyIndicatorManager/xBusyIndicator.xaml.cs
|
||
|
|
- Common/DTS.Common/BusyIndicatorManager/BusyIndicatorManager.cs
|
||
|
|
generated_at: "2026-04-17T16:07:35.693278+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "e6aa8724b93b00bb"
|
||
|
|
---
|
||
|
|
|
||
|
|
# BusyIndicatorManager
|
||
|
|
|
||
|
|
### Purpose
|
||
|
|
This module provides a thread-safe singleton manager for coordinating busy indicator UI state across the application. It supports multiple concurrent busy operations tracked by integer IDs, allowing nested or overlapping operations to display appropriate messages. The manager implements `INotifyPropertyChanged` via Prism's `BindableBase` to support XAML data binding.
|
||
|
|
|
||
|
|
### Public Interface
|
||
|
|
|
||
|
|
**BusyIndicatorManager : BindableBase (Singleton)**
|
||
|
|
|
||
|
|
*Properties:*
|
||
|
|
- `static BusyIndicatorManager Instance { get; }` — Thread-safe singleton accessor using double-checked locking pattern with `SyncRoot`.
|
||
|
|
- `bool IsBusy { get; }` — Returns `true` when one or more busy operations are active. Setter is private; managed via `ShowBusy`/`CloseBusy`.
|
||
|
|
- `string Message { get; }` — Returns the message of the most recently added busy operation. Setter is private; managed via `ShowBusy`/`CloseBusy`.
|
||
|
|
|
||
|
|
*Methods:*
|
||
|
|
- `void ShowBusy(int id, string busyMessage)` — Registers or updates a busy operation with the given `id`. Sets `IsBusy = true` and updates `Message` to `busyMessage`. If the `id` already exists, its message is updated.
|
||
|
|
- `void CloseBusy(int id)` — Removes the busy operation with the given `id`. If no operations remain, sets `IsBusy = false` and `Message = string.Empty`. If operations remain, keeps `IsBusy = true` and sets `Message` to the last entry's value (via `busyParameters.Last().Value`).
|
||
|
|
|
||
|
|
### Invariants
|