FindMyFiles

FindMyFiles.ViewModels

NotificationCenter Class

The InfoBar notification stack: capped at three, Info entries dissolve after five seconds. Every error path in the app funnels through here via Notifier. UI thread only (the Notifier subscription marshals).

public sealed class NotificationCenter

Inheritance System.Object → NotificationCenter

Constructors

NotificationCenter(IDispatcher) Constructor

Create the stack bound to dispatcher, used to marshal posts onto the UI thread and to drive the Info auto-dismiss timer.

public NotificationCenter(FindMyFiles.Services.IDispatcher dispatcher);

Parameters

dispatcher IDispatcher

UI-thread dispatch boundary.

Properties

NotificationCenter.Items Property

The live InfoBar stack (oldest first, capped at three), x:Bind'd by the view. Mutated on the UI thread only.

public System.Collections.ObjectModel.ObservableCollection<FindMyFiles.Services.AppNotification> Items { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<AppNotification>

Methods

NotificationCenter.AttachToNotifier() Method

Drain the process-wide funnel into this stack.

public void AttachToNotifier();

NotificationCenter.Push(AppNotification) Method

Append n to the stack, evicting the oldest entries to stay within the three-item cap; Info entries also schedule their own five-second removal. UI thread only.

public void Push(FindMyFiles.Services.AppNotification n);

Parameters

n AppNotification

The notification to show.

NotificationCenter.Remove(AppNotification) Method

Remove n from the stack — the InfoBar close button's target. No-op if it is already gone. UI thread only.

public void Remove(FindMyFiles.Services.AppNotification n);

Parameters

n AppNotification

The notification to dismiss.