This is from a newbie in Silverlight. I’ve a Silverlight app hosted in an ASP.NET application. What I need is to get the virtual directory path in the code behind of a XAML file. In ASP.NET, HttpRuntime.AppDomainAppVirtualPath would have done the needful. How can I achieve the same objective in SL?
This is from a newbie in Silverlight. I’ve a Silverlight app hosted in an
Share
Couldn’t quite get the virtual path, but found an acceptable workaround.
Application.Current.Host.Sourcewill always give the source of my .xap file within the ClientBin folder. This Uri will also have the virtual directory in it, if there is one. So I obtained a substring from it, by chopping off the portion starting from the ClientBin part and appended the relative Uri of the required resource to the substring.