Not able to reference Image source with relative path in xaml

后端 未结 3 1695
鱼传尺愫
鱼传尺愫 2020-12-15 17:04

I have created a ClassLibrary project, and added a xaml of Window type. I wrote a console application and showing this wpf window.

The problem is I have to show an I

3条回答
  •  攒了一身酷
    2020-12-15 17:35

    I got this working by:

    1. Name of my WPF User Control project: WpfControls

    2. Name of the folder containing the image: Images

    3. Name of the imgae file: Asdf.png

    4. Include the folder and image file into the WpfControls project

    5. The image file's Build Action set to Resource

    6. The Source property in the Image tag set to:

提交回复
热议问题