Tag: winrt的asynchronous

asynchronous实现IValueConverter

如果我想在一个IValueConverter内部触发asynchronous方法。 有没有更好的等待,然后强制它通过调用结果属性同步? public async Task<object> Convert(object value, Type targetType, object parameter, string language) { StorageFile file = value as StorageFile; if (file != null) { var image = ImageEx.ImageFromFile(file).Result; return image; } else { throw new InvalidOperationException("invalid parameter"); } }