<PackageReference Include="System.Reactive" Version="6.0.1" />

IHostLifecycleNotifications

public interface IHostLifecycleNotifications
(Infrastructure) Provides notifications about the host's lifecycle events.
using System.ComponentModel; using System.Runtime.CompilerServices; namespace System.Reactive.PlatformServices { [System.Runtime.CompilerServices.NullableContext(1)] [EditorBrowsable(EditorBrowsableState.Never)] public interface IHostLifecycleNotifications { event EventHandler<HostSuspendingEventArgs> Suspending; event EventHandler<HostResumingEventArgs> Resuming; } }