ARTICLE

Windows Store Development Tips and Tricks 5 : Content Referencing using URIs

Posted by Ibrahim Ersoy Articles | Windows Store Apps September 07, 2012
Beginning Windows 8? These tips will help you master it. Trick 5: Content Referencing using URIs
Reader Level:

You have nice images, videos, web pages and other kind of content files in your project.


And you don't know how to reference them dynamically?
 
The given code example will help you load an image dynamically:
 
using Windows.UI.Xaml.Media.Imaging;
image1.Source = new BitmapImage(new Uri("ms-appx:///Assets/welcome.png")); 

As you well know generally we would access a content using BitMapImage with its UriKind parameter.

In XAML based apps,there is no such relative path because every app is deployed as a package.so vs2012 provides us a scheme to access content files in a folder: "ms-appx:///FolderName/contentfile"

You can use ms-appx scheme to access your files dynamically.
  

Login to add your contents and source code to this article
post comment
     

From a developer perspective; its called Windows Store Applications.But i dont know why they keep confusing us.

Posted by Ibrahim Ersoy Sep 07, 2012

So, should we call Metro Style apps now Windows Store apps? I see some Microsoft experts are calling them Windows 8 apps.

Posted by Mahesh Chand Sep 07, 2012
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.