Reputation: 6194
I had a number of CSV files embedded within a Silverlight DLL (as Resource). I need to move these into the XAP (as Content rather than resource). The trouble is Application.GetResourceStream always seems to return null when I try and access the files. I have tried a number of ways to achieve this but can't seem to do it. How do you reference the CSV files from code behind?
Thanks in advance.
Upvotes: 3
Views: 1457
Reputation: 16102
How to Get Files From Resources in Silverlight 2.0
StreamResourceInfo sr = Application.GetResourceStream(new Uri("MyImage.png", UriKind.Relative));
BitmapImage bmp = new BitmapImage();
bmp.SetSource(sr.Stream);
Upvotes: 5