0

I have these in my App.xaml :

<Application.Resources>
    <BitmapImage x:Key="myImage1" UriSource="/marathon1.jpg" />
    <BitmapImage x:Key="myImage2" UriSource="/marathon2.png" />
    <BitmapImage x:Key="myImage3" UriSource="/marathon3.jpg" />
    <BitmapImage x:Key="myImage4" UriSource="/marathon4.jpg" />

</Application.Resources>

And these in MainWindow.xaml :

<Image Source="{StaticResource myImage1}"/>
<Image Source="{StaticResource myImage3}"/>
<Image Source="{StaticResource myImage4}"/>
<Image Source="{StaticResource myImage2}"/>

I can see the images in design time, but they are not visible when I run the application. How can I fix this? Thanks

jason
  • 6,962
  • 36
  • 117
  • 198
  • The image files must be added to your Visual Studio project and their Build Action (in Properties window) must be set to `Resource`. – Clemens Aug 01 '14 at 09:20
  • @Clemens I can't see Buid Action in properties window. – jason Aug 01 '14 at 09:26
  • 1
    Properties of each image file in your Visual Studio project. See [here](http://stackoverflow.com/a/12693661/1136211). – Clemens Aug 01 '14 at 09:28

0 Answers0