File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Examples/UniversalDemo/UniversalDemo/UniversalDemo.Shared/ViewModel Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,14 @@ public async Task Update(bool replaceImage = false)
7373 using ( var download = await client . Files . DownloadAsync ( "/" + this . Name ) )
7474 {
7575 var stream = await download . GetContentAsStreamAsync ( ) ;
76+
77+ // Convert the stream to the memory stream, because a memory stream supports seeking.
78+ var memStream = new MemoryStream ( ) ;
79+ await stream . CopyToAsync ( memStream ) ;
80+ memStream . Position = 0 ;
81+
7682 var bitmap = new BitmapImage ( ) ;
77- await bitmap . SetSourceAsync ( stream . AsRandomAccessStream ( ) ) ;
83+ await bitmap . SetSourceAsync ( memStream . AsRandomAccessStream ( ) ) ;
7884 this . Image = bitmap ;
7985 this . NotifyPropertyChanged ( "Image" ) ;
8086
You can’t perform that action at this time.
0 commit comments