Managing application state with app life cycle events
Before working with data in any application, it is important to understand the application life cycle 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 life cycle for WinUI on UWP applications.
Exploring Windows application life cycle events
WinUI on UWP applications have a different set of life cycle events than Win32 applications. Win32 applications are either running or they're not. There are several events that occur while launching and shutting down WPF and WinForms applications:
Note
We won't go into the details here, as our primary focus is building WinUI on UWP applications. However, the two WPF events that fall outside of the launch and close their sequences are as follows:
a. FrameworkElement.Unloaded
: This event fires...