This project is read-only.

Image Control display Image only by designtime

Jul 12, 2014 at 1:15 PM
Hello together,

I will display a picture in an image control. By designtime the control display the image. When the programm is runnning the image control doesn´t display the picture. I can´t explain it.

Here a simple example:
<UserControl x:Class="ModernUIApp1.Pages.Home"
           
..... >
    <Grid Style="{StaticResource ContentRoot}">
        <ScrollViewer>
            <Image  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Source="/NoCam.png"/>
        </ScrollViewer>
    </Grid>
</UserControl>
The path is correct. The image is stored in the root of my solution.

By designtime:
Image

By runtime:
Image

Any idea?

With greetings
Jul 12, 2014 at 1:49 PM
I think in your main window(ModernWindow) you have to set the contentSource
example:
ContentSource="/Pages/Home.xaml"
Jul 12, 2014 at 2:07 PM
Edited Jul 12, 2014 at 2:07 PM
It is from the begin...

No positive result :-(
Jul 15, 2014 at 4:20 PM
Make sure you're image is copied to the output directory. (see Build Action on the image file's properties within VisualStudio)