locked
XAML Image Tag - No Picture Showing RRS feed

  • Question

  • I am just starting to learn C# and XAML. Have created a basic app in Visual Studio Express 2013 and in my MainPage.xaml file have added the following tag:

    <image source="Jasper.jpg" Margin="120" />

    I have also placed the Jasper.jpg photo in the folder right next to the XAML file.  When I build and run the project, I never see a picture.  I have experimented with different pictures in case it was my JPG file, but am having no success.  It's my first piece of code in a Windows 8 App project and can't get it to work.  :-O  What am I misunderstanding?

    Saturday, November 9, 2013 5:44 PM

Answers

  • I figured it out.  Didn't realize I had to add it as an asset in Visual Studio and set that to Content build action, and not the XAML page.

    Thanks

    • Proposed as answer by Dave SmitsMVP Sunday, November 10, 2013 7:20 PM
    • Marked as answer by S O'Connor Sunday, November 10, 2013 8:33 PM
    Saturday, November 9, 2013 8:03 PM