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

WIP: observatory UI overhaul

This commit is contained in:
Xjph
2023-07-07 08:36:27 -02:30
parent 1d62a0ec1d
commit d99a190869
28 changed files with 1448 additions and 386 deletions

View File

@ -15,25 +15,29 @@ namespace Observatory.NativeNotification
public Guid InvokeNativeNotification(NotificationArgs notificationArgs)
{
var notificationGuid = Guid.NewGuid();
var notification = new NotificationForm()
Application.OpenForms[0].Invoke(() =>
{
Guid = notificationGuid
};
notification.Show();
notifications.Add(notificationGuid, notification);
//TODO: Implement winform notification
var notification = new NotificationForm(notificationGuid, notificationArgs);
notification.FormClosed += NotifyWindow_Closed;
notifications.Add(notificationGuid, notification);
notification.Show();
});
return notificationGuid;
}
private void NotifyWindow_Closed(object sender, EventArgs e)
private void NotifyWindow_Closed(object? sender, EventArgs e)
{
var currentNotification = (NotificationForm)sender;
if (notifications.ContainsKey(currentNotification.Guid))
if (sender != null)
{
notifications.Remove(currentNotification.Guid);
var currentNotification = (NotificationForm)sender;
if (notifications.ContainsKey(currentNotification.Guid))
{
notifications.Remove(currentNotification.Guid);
}
}
}
@ -49,8 +53,7 @@ namespace Observatory.NativeNotification
{
if (notifications.ContainsKey(guid))
{
//TODO: Update notification content
// notifications[guid].DataContext = new NotificationViewModel(notificationArgs);
notifications[guid].Update(notificationArgs);
}
}