allow multiple simultaneous popup notifications to vertically stack

This commit is contained in:
Xjph 2021-10-23 15:47:38 -02:30
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)