NotificationStack
Namespace: Hex1b
Assembly: Hex1b.dll
Manages a collection of notifications with floating/docked state tracking and timeout handling.
public sealed class NotificationStackInheritance
Object → NotificationStack
Properties
All
Gets all active notifications in the stack (both floating and docked). Newest notifications are first.
Returns: IReadOnlyList<Notification>
public IReadOnlyList<Notification> All { get; }Count
Gets the count of all notifications.
Returns: Int32
public int Count { get; }Floating
Gets notifications that are currently floating (visible as overlays). Newest notifications are first.
Returns: IReadOnlyList<Notification>
public IReadOnlyList<Notification> Floating { get; }FloatingCount
Gets the count of floating notifications.
Returns: Int32
public int FloatingCount { get; }IsPanelVisible
Whether the notification panel/drawer is visible.
Returns: Boolean
public bool IsPanelVisible { get; set; }Methods
CancelTimeout(Notification)
Cancels the timeout for a specific notification. The notification will remain visible until explicitly dismissed.
Parameters:
notification(Notification): The notification to cancel the timeout for.
public void CancelTimeout(Notification notification)Dismiss(Notification)
Dismisses a notification, removing it from the stack entirely.
Parameters:
notification(Notification): The notification to dismiss.
Returns: Boolean
True if the notification was found and removed.
public bool Dismiss(Notification notification)DismissAll()
Dismisses all notifications from the stack.
public void DismissAll()HideFromFloating(Notification)
Hides a notification from floating view without dismissing it. The notification remains in the panel.
Parameters:
notification(Notification): The notification to hide.
public void HideFromFloating(Notification notification)HidePanel()
Hides the notification panel/drawer.
public void HidePanel()IsFloating(Notification)
Checks if a notification is currently floating.
Parameters:
notification(Notification): The notification to check.
Returns: Boolean
True if the notification is floating.
public bool IsFloating(Notification notification)Post(Notification)
Posts a new notification to the stack. The notification will appear as a floating overlay.
Parameters:
notification(Notification): The notification to post.
public void Post(Notification notification)ShowPanel()
Shows the notification panel/drawer. When the panel opens, all currently floating notifications are hidden from the floating view (they remain visible in the drawer). This signals that the user has seen them.
public void ShowPanel()TogglePanel()
Toggles the notification panel/drawer visibility. When opening, all currently floating notifications are hidden from the floating view (they remain visible in the drawer).
public void TogglePanel()Events
Changed
Event raised when the notification collection changes.
Returns: Action
public event Action? ChangedRemarks
The notification stack is the central manager for all notifications in an application. It tracks: All active notificationsWhich notifications are currently "floating" (visible as overlays)Timeout timers for auto-hiding from floating viewPanel/drawer visibility state
Notification lifecycle: Floating: Visible as overlay card, countdown timer running.Docked: Timed out or drawer opened - no longer floating but still in panel.Dismissed: Removed from the stack entirely.
Access the notification stack from event handlers via e.Context.Notifications or through the property.
Examples
Posting a notification from a button click:
ctx.Button("Save").OnClick(e => {
SaveFile();
e.Context.Notifications.Post(
new Notification("File Saved", "document.txt saved successfully")
.Timeout(TimeSpan.FromSeconds(5))
.PrimaryAction("Open Folder", async ctx => OpenFolder())
);
});