Десериализовать Uri в WriteableBitmap

#c# #json #serialization #uwp

#c# #json #сериализация #uwp

Вопрос:

Я сериализовал свое изображение, Uri и у меня возникли проблемы с десериализацией

 var storageFile = await StorageFile.GetFileFromPathAsync(temp[0].BackStage.AbsoluteUri);
 using (var stream = await storageFile.OpenReadAsync())
 {
  await BackStageImg.SetSourceAsync(stream);
 }
  

Этот код не работает, он говорит «У вас нет доступа», когда я пытаюсь Uri StorageFile

Ответ №1:

Я скопировал свой файл App Local Folder и выбрал, как

 StorageFile localFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appdata:///local/background"));