Exploring the problem that the Image of the Image control of WPF cannot be displayed,
In the wpf project, Image is used to display resource images, which can be displayed on the Interface but cannot be displayed during running.
<Image Source = "/Reform. STBHQ. common; component/Images/huaiy_0.png "Height =" 80 "HorizontalAlignment =" Left "Margin =" 80, 0, 0, 0 "Cursor =" Hand "cm: Message. attach = "[MouseLeftButtonUp] = [RestoreDB_Click ()]"> </Image>
After checking the image Resource file, it is found that the image generation method in the root directory is incorrect. Right-click the Image property and choose "generate" as the content instead of "Resource ".
Therefore, you need to change the generate operation to Resource.
The generate operation is set to Resource. The Resource will be added to the Assembly when it is generated. You can try to delete the original image. The image is displayed normally. Replace the original image with the new one, and the original image is still displayed. Images can be updated only when you select "regenerate.
The generated operation is set to content and will not be added to the Assembly. resources can be accessed only when resources are placed in the program running directory. The Debug directory is used for program running directory debugging, and the installation directory is used after installation. Unlike directly Placing resources in the program running directory, adding a Content resource file will add a custom feature to the AssemblyAssociatedContentFile to check whether the Assembly record file exists and its relative location.