/// <summary> /// Represents an image for an item base. First the classes's image will be loaded synchronously, /// which is then used as the image until the base item's image is loaded asynchronously. /// </summary> public ItemImage(ItemImageService itemImageService, string baseName, ItemClass baseClass) { var defaultImage = itemImageService.LoadDefaultImage(baseClass); ImageSource = NewImageSourceTask( itemImageService.LoadItemImageAsync(baseName, Task.FromResult(defaultImage)), "Loading of base item image failed", defaultImage ); }
/// <summary> /// Represents an image for an item class. The image will be loaded synchronously. /// </summary> public ItemImage(ItemImageService itemImageService, ItemClass baseClass) { var defaultImage = itemImageService.LoadDefaultImage(baseClass); ImageSource = NewImageSourceTask( Task.FromResult(defaultImage), "Exception in completed task", defaultImage ); }