Skip to content

Commit a3ef45b

Browse files
loneursidEric Langlois
andauthored
Make NotificationManager first thing initialized at start up (#249)
Co-authored-by: Eric Langlois <[email protected]>
1 parent 2e269e8 commit a3ef45b

File tree

2 files changed

+5
-6
lines changed
  • Samples/Notifications/App
    • CppUnpackagedAppNotifications/CppUnpackagedAppNotifications
    • CsUnpackagedAppNotifications/CsUnpackagedAppNotifications

2 files changed

+5
-6
lines changed

Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ namespace winrt::CppUnpackagedAppNotifications::implementation
3030

3131
App::App()
3232
{
33+
g_notificationManager.Init();
34+
3335
InitializeComponent();
3436
app = this;
3537

@@ -74,8 +76,6 @@ namespace winrt::CppUnpackagedAppNotifications::implementation
7476
{
7577
window = make<MainWindow>();
7678

77-
g_notificationManager.Init();
78-
7979
// NOTE: AppInstance is ambiguous between
8080
// Microsoft.Windows.AppLifecycle.AppInstance and
8181
// Windows.ApplicationModel.AppInstance

Samples/Notifications/App/CsUnpackagedAppNotifications/CsUnpackagedAppNotifications/App.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ public partial class App : Application
1919

2020
public App()
2121
{
22+
notificationManager = new NotificationManager();
23+
notificationManager.Init();
24+
2225
this.InitializeComponent();
2326
AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit);
24-
25-
notificationManager = new NotificationManager();
2627
}
2728

2829
public static void ToForeground()
@@ -50,8 +51,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
5051
{
5152
mainWindow = new MainWindow();
5253

53-
notificationManager.Init();
54-
5554
// NOTE: AppInstance is ambiguous between
5655
// Microsoft.Windows.AppLifecycle.AppInstance and
5756
// Windows.ApplicationModel.AppInstance

0 commit comments

Comments
 (0)