BuildItArSample.UWP.MainPage.Application_Suspending C# (CSharp) Method

Application_Suspending() private method

private Application_Suspending ( object sender, SuspendingEventArgs e ) : void
sender object
e Windows.ApplicationModel.SuspendingEventArgs
return void
        private void Application_Suspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();
            try
            {
                world?.StopSensors();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            finally
            {
                deferral.Complete();
            }
        }