Hello, Welcome to Micorosoft Q&A,
It looks local variable bitmap was released when navigate to other page, for this scenario, a quickly solution reload the file when page go back. Please copy the following code into Selecting_OnLoaded
merhod
private async void Selecting_OnLoaded(object sender, RoutedEventArgs e) {
ImagesList.ItemsSource = imageListData;
imageListData.CollectionChanged += (o, args) => ImagesList_OnSelectionChanged(null, null);
if (imageListData.Count > 0) {
foreach (StorageFile file in imageListData) {
await Dispatcher.RunIdleAsync(async (_) => {
var items = VisualTreeHelperEx.GetDescendants(ImagesList);
foreach (var item in items) {
if (!(item is Image image))
continue;
if ((string)image.Tag != file.Path)
continue;
var bit = new BitmapImage();
await bit.SetSourceAsync(await file.OpenReadAsync());
image.Stretch = Stretch.UniformToFill;
image.Source = bit;
}
});
}
}
var addCommand = new StandardUICommand(StandardUICommandKind.Open);
......
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.