private async void RestartWhenAllWindowsClosed()
 {
     while (appWindowManager.AnyAppWindowIsOpen())
     {
         await Task.Delay(TimeSpan.FromSeconds(5));
     }
     log.Info("Restarting after update.");
     UpdateManager.RestartApp();
 }
        private void Timer_Tick(object sender, EventArgs e)
        {
            if (appWindowManager.AnyAppWindowIsOpen() || !networkService.IsWorkNetwork)
            {
                // Suppress all timed reminders while app windows are open.
                // This avoids immediately showing reminders to new or newly opted-in users.
                // Also suppresses any notifications if user is not on a work network.
                return;
            }

            if (ShouldShowLastToLeaveReminder())
            {
                ShowLastToLeaveReminder();
            }

            if (ShouldShowFirstLoginReminder())
            {
                ShowFirstLoginReminder();
            }
        }