2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-03 09:03:42 -04:00

Added notification window

This commit is contained in:
Xjph
2021-06-04 16:54:14 -02:30
parent a5154996ee
commit 4ff438454f
3 changed files with 38 additions and 6 deletions

View File

@ -9,11 +9,26 @@ namespace Observatory.UI.Views
public NotificationView()
{
InitializeComponent();
SystemDecorations = SystemDecorations.None;
var screenBounds = Screens.Primary.Bounds;
Position = screenBounds.BottomRight - new PixelPoint((int)Width, (int)Height);
var timer = new System.Timers.Timer();
timer.Elapsed += CloseNotification;
timer.Interval = 5000;
timer.Start();
#if DEBUG
this.AttachDevTools();
#endif
}
private void CloseNotification(object sender, System.Timers.ElapsedEventArgs e)
{
Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() =>
{
Close();
});
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);