Saturday, 10 August 2013

#EANF#

#EANF#

Currently I add an image in XAML this way :
Put the file in the project's folder, in a sub-directory named "Resources",
Set its "Build Action" property to "Resource",
Add in my XAML file : <Image Source="/Resources/myImage.png />
And it works great.
But in SO I keep seeing people writing this instead :
<Image
Source="pack://application:,,,/MyApplicationNamespace;component/Resources/myImage.jpg"
/>
Also recently, I've found that in Project Properties -> Resources, you can
add files like images, texts...
So which of these 3 possibilities should I use ?

No comments:

Post a Comment