This repository has been archived on 2025-07-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
EnvyUpdate/EnvyUpdate/App.xaml.cs

36 lines
1,012 B
C#
Raw Normal View History

2022-12-26 16:30:02 +01:00
using Microsoft.Toolkit.Uwp.Notifications;
using System;
2019-11-08 19:30:32 +01:00
using System.Collections.Generic;
using System.Configuration;
using System.Data;
2021-09-06 22:26:41 +02:00
using System.Diagnostics;
2019-11-08 19:30:32 +01:00
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
2022-12-26 16:30:02 +01:00
using Windows.Foundation.Collections;
2023-07-14 12:37:00 +02:00
using Wpf.Ui.Markup;
2019-11-08 19:30:32 +01:00
namespace EnvyUpdate
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
2022-12-26 16:30:02 +01:00
protected override void OnStartup(StartupEventArgs e)
{
// Listen to notification activation
2023-07-14 22:03:26 +02:00
ToastNotificationManagerCompat.OnActivated += ToastNotificationManagerCompat_OnActivated;
}
2022-12-26 16:30:02 +01:00
2023-07-14 22:03:26 +02:00
private void ToastNotificationManagerCompat_OnActivated(ToastNotificationActivatedEventArgsCompat e)
{
// Need to dispatch to UI thread if performing UI operations
Application.Current.Dispatcher.Invoke(delegate
{
Util.ShowMain();
});
2022-12-26 16:30:02 +01:00
}
2019-11-08 19:30:32 +01:00
}
}