Files
DP44/docs/ai/Common/DTS.Common/BusyIndicatorManager.md
2026-04-17 14:55:32 -04:00

1.7 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.Common/BusyIndicatorManager/xBusyIndicator.xaml.cs
Common/DTS.Common/BusyIndicatorManager/BusyIndicatorManager.cs
2026-04-17T16:07:35.693278+00:00 zai-org/GLM-5-FP8 1 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