Вам необходимо поддерживать очередь уведомлений, чтобы каждое уведомление появлялось за другим. Для этого вам нужно управлять такой очередью с помощью собственного кода.
Вот такой менеджер очередей уведомлений, который я выбил.
public static class NotificationManager
{
private static Queue<FrameworkElement> queue = new Queue<FrameworkElement>();
private static NotificationWindow window = new NotificationWindow();
private static int duration = 5000;
static NotificationManager()
{
window.Closed += window_Closed;
}
public static void Notify(FrameworkElement content)
{
if (Deployment.Current.Dispatcher.CheckAccess())
{
if (window.Visibility == Visibility.Collapsed && queue.Count == 0)
{
Show(content);
}
else
{
queue.Enqueue(content);
}
}
else
{
Deployment.Current.Dispatcher.BeginInvoke(() => Notify(content));
}
}
public static void CloseCurrentNotification()
{
window.Close();
}
private static void window_Closed(object sender, EventArgs e)
{
if (queue.Count > 0)
{
Show(queue.Dequeue());
}
}
private static void Show(FrameworkElement content)
{
window.Content = content;
window.Height = content.Height;
window.Width = content.Width;
window.Show(duration);
}
}
Вы можете настроить свой код на: -
NotifyWindow win = new NotifyWindow();
win.Header.Text = "Custom Message Header";
win.Description.Text = "This is a custom description.";
NotificationManager.Notify(win);
Если вы будете вызывать такой код несколько раз, вы просто получите несколько уведомлений (хотя может быть трудно определить, не изменился ли текст).