public override void LoadedFromData(ILazyLoadingItem loadedData) { if (IsCached) { return; } IsCached = true; if (!string.IsNullOrEmpty(this.ThumbnailKey)) { using (var proxy = new MogamiApiServiceClient()) { proxy.Login(); var loadthumbparam = new REQUEST_LOADTHUMBNAIL { ThumbnailKey = ThumbnailKey }; var rsp = proxy.LoadThumbnail(loadthumbparam); using (Stream stream = new MemoryStream(rsp.ThumbnailBytes)) { // ロックしないように指定したstreamを使用する。 BitmapDecoder decoder = BitmapDecoder.Create( stream, BitmapCreateOptions.None, // この辺のオプションは適宜 BitmapCacheOption.Default // これも ); BitmapSource bmp = new WriteableBitmap(decoder.Frames[0]); bmp.Freeze(); this.Thumbnail = bmp; } } } }