this code looks like it uses a global mutex to allow only one instance of the app. uses an injected object to log application main window open close, and uncaught errors.
you will need to design a solution for each O/S. while the global mutex will work on linux and MacOs, it will be buggy (false detection of running app) due to the mutex implementation code. not needed for mobile O/S.
the Maui lifecycle events match the mobile o/s where apps are visible or not visible, background, active, or stopped.