dotnet / dotnet/wpf

Issue with BitmapImage not Displaying after Deserialization Process

Open
#9,173 3 comments 1 reaction 0 assignees View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

## Issue Description ##
We have set the image source to be a BitmapImage, which we defined using the CustomClass. Initially, the image was displayed properly. We performed serialization for the CustomClass. However, after deserializing, the image was not displayed. Upon further analysis, we found that during the serialization process, the image values were saved with the file path. But during the deserialization process, the image value was a BitmapImage and the file path was null.

## Video reference ##

https://github.com/dotnet/wpf/assets/153497178/d100efc9-8daa-4c15-9ef0-c48ad157eb75

## Steps to reproduce ##
1. Run the sample
2. Click the Deserialize button.

## Excepted Behavior ##
Image should be displayed properly.

## Observed behavior ##
Image doesn't displayed.

## Sample ##
[Serialization.zip](https://github.com/dotnet/wpf/files/15483386/Serialization.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.