public static ImageSource GetCamouflagePreview(Camouflage camouflage, WpfColor baseColor, IRepository repository) { var client = repository as LocalGameClient; if (client == null) { return(null); } var cacheFilename = string.Format("camouflage_{0}_{1}.png", camouflage.Id, camouflage.Key); return(client.CacheManager.Load(cacheFilename, () => CamouflagePreview.CreateCamouflagePreview(client, camouflage, baseColor), CamouflagePreview.LoadCamouflagePreview, CamouflagePreview.SaveCamouflagePreview)); }
public CamouflageVM(Camouflage camouflage, WpfColor baseColor, IRepository repository) { _model = camouflage; this.PreviewImage = CamouflagePreview.GetCamouflagePreview(camouflage, baseColor, repository); }