How to get the path where is the silverlight xap file is served

In case you are developing a silverlight application that contains images. You can set the build action of these images to Embedded Resource so as to have them within your XAP file and hence reference them relatively. However, in case you do not want to do so, you can still reference your images easily by setting their passes relative to the current path of the XAP file. The line of code below gets the current path of the running XAP file.


Application.Current.Host.Source

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: