namespace ScadaLink.CentralUI.Components.Shared;
///
/// Default implementation. Holds the currently
/// open dialog state in and notifies subscribers (the
/// DialogHost component) via . Only a single
/// dialog can be open at a time; attempting to open another while one is
/// already active throws — there is
/// no nested-dialog use case today and surfacing the bug is preferable to
/// silently queuing.
///
public class DialogService : IDialogService
{
///
/// Raised whenever changes (dialog opened or closed).
/// The host component subscribes and calls StateHasChanged.
///
public event Action? OnChange;
///
/// The dialog currently being displayed, or null when no dialog is
/// open. The host reads this to decide what (if anything) to render.
///
public DialogState? Current { get; private set; }
private TaskCompletionSource