2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 16:33:43 -04:00

allow multiple simultaneous popup notifications to vertically stack

This commit is contained in:
Xjph
2021-10-23 15:47:38 -02:30
parent 08a8aa3156
commit 310287b0af
3 changed files with 40 additions and 4 deletions

View File

@ -22,6 +22,12 @@ namespace Observatory.NativeNotification
{
var notifyWindow = new NotificationView(notificationGuid) { DataContext = new NotificationViewModel(notificationArgs) };
notifyWindow.Closed += NotifyWindow_Closed;
foreach (var notification in notifications)
{
notification.Value.AdjustOffset(true);
}
notifications.Add(notificationGuid, notifyWindow);
notifyWindow.Show();
});
@ -31,10 +37,12 @@ namespace Observatory.NativeNotification
private void NotifyWindow_Closed(object sender, EventArgs e)
{
var notification = (NotificationView)sender;
var currentNotification = (NotificationView)sender;
if (notifications.ContainsKey(notification.Guid))
notifications.Remove(notification.Guid);
if (notifications.ContainsKey(currentNotification.Guid))
{
notifications.Remove(currentNotification.Guid);
}
}
public void CloseNotification(Guid guid)