I'm migrating one of my apps from WP 8.0 to UWP. I have some JSON content that I'd like to hide from a regular user. In previous version I was able to set build action of those JSON files to 'Embedded Resource' and iterate them using:
Application.GetResourceStream(new Uri(path, UriKind.Relative));
But this method is not available in UWP.
So is there any way to read embedded resources in UWP? Or maybe there is an alternative way to store those files, other than setting the build action to 'Content'?
You can iterate through list of available resources using method of Assembly class:
var names = someInstance.GetType()
.GetTypeInfo()
.Assembly
.GetManifestResourceNames();
And then load resource by full name from the list above:
var stream = someAssembly.GetManifestResourceStream(name);
And then do whatever you want with the stream.