Пример #1
0
        private void OnSuspending(object sender, SuspendingEventArgs args)
        {
            // Save app state asynchronously after requesting a deferral. Holding a deferral
            // indicates that the application is busy performing suspending operations. Be
            // aware that a deferral may not be held indefinitely; after about five seconds,
            // the app will be forced to exit.
            var deferral = args.SuspendingOperation.GetDeferral();

            Task.Run(async() =>
            {
                deviceResources.Trim();

                if (null != main)
                {
                    main.SaveAppState();
                }

                await UninitializeRecognizer();

                deferral.Complete();
            });
        }