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:
@ -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);
|
||||
|
Reference in New Issue
Block a user