public async Task <UIImageData> GetData(string identifier, CancellationToken token) { UIImage image = null; await _mainThreadDispatcher.PostAsync(() => image = UIImage.FromBundle(identifier)).ConfigureAwait(false); return(new UIImageData() { Image = image, Result = LoadingResult.CompiledResource, ResultIdentifier = identifier }); }
public static async Task InitAsync() { if (!_scale.HasValue) { IMainThreadDispatcher dispatcher = ImageService.Instance.Config.MainThreadDispatcher; await dispatcher.PostAsync(delegate { _scale = 1.0; }).ConfigureAwait(continueOnCapturedContext: false); } }