Managing application state with app lifecycle events
Before working with data in any application, it is important to understand the application lifecycle for the target application platform. We have touched on these concepts briefly, but now, it’s time to take a deeper dive into the Windows application lifecycle for WinUI on Desktop applications.
Exploring Windows application lifecycle events
WinUI on desktop applications has a slightly different set of lifecycle events than other desktop .NET applications. WPF and Windows Forms (WinForms) applications are either running or they’re not. There are several events that occur while launching and shutting down WPF and WinForms applications:
Figure 6.1 – WPF and WinForms application lifecycle events
Note
We won’t go into the details here, as our primary focus is building WinUI 3 applications. However, for the two WPF events that fall outside of the launch and close, their...