I have a Portable Library which I am using for a Windows Phone application. In that same Portable Library, I have a couple of content files (Build Action = Cont
Add your file to portable resource and set build action to Embedded Resource. For example files GB.png, US.png under folder CountryFlags.
Add a getter function with code like this (here it's specific for our countryflag getter image).
public class CountryFlags {
public static Stream GetFlagStream(string countryIsoCode2ch)
{
var flagname = "Full.DLL.Name.CountryFlags.{0}.png";
var rs = Assembly.GetExecutingAssembly().GetManifestResourceStream(
string.Format(flagname, countryIsoCode2ch));
return rs;
}
}
Here Full.DLL.Name is the part of generated portable library that is before .dll extension. (Note: Anything.Resources.dll is a bad name for a library because it gets ignored by Visual Studio at least when generating XAP etc.; instead for example Anything.PortableResource.dll will work).