Image shows up in Visual Studio designer but not during run-time

后端 未结 19 2042
独厮守ぢ
独厮守ぢ 2020-12-17 08:09

I\'m currently working w/ VS studio 2010, .NET 4.0. Here is my scenario:

I currently have a class library project called \"Images\" that contains a sub folder calle

19条回答
  •  盖世英雄少女心
    2020-12-17 08:15

    Well, I waisted more than 3 hours of my time on this problem. Your answers helped me to partially solve the problem and that's what urged me to add to this useful discussion.

    I got my problem solved as:

    1. select all images in your solution explorer resources.
    2. Right click and go to properties.
    3. Build action to "Embedded Resource"
    4. Copy to Output to "Copy Always"
    5. save and build solution.
    6. add image and take care or the ZIndex value.
    7. After all of that I found my self when I use the image multiple times or try to change to another image on the same image control to change the path for the image either on XAML or in the image control properties to be:

      source="pack:://siteoforigin:,,,/Resources/image.png"
      

提交回复
热议问题