Пример #1
0
        private static async void ContinueShowShareUI(ShareUIOptions options, DataPackage dataPackage)
        {
            try
            {
                // Because showing the Share UI is a fire-and-forget operation
                // and retrieving data from DataPackage requires async-await,
                // this method must be async void.
                var result = await ShowShareUIAsync(options, dataPackage);

                if (result)
                {
                    dataPackage.OnShareCompleted();
                }
                else
                {
                    dataPackage.OnShareCanceled();
                }
            }
            catch (Exception ex)
            {
                if (_instance.Value.Log().IsEnabled(LogLevel.Error))
                {
                    _instance.Value.Log().LogError($"Exception occurred trying to show share UI: {ex}");
                }
                dataPackage.OnShareCanceled();
            }
        }