android - MVVMCross Resource Loader -
As I have understood, IMVXsourceSource can load resources from platform-specific projects to "Assets" or "Resource" folders is. If this is true, is there a way / plugin that will load the embedded resources from the shared core project? It is easy to keep resources related to business logic (or localization) in a place rather than copying iOS / Windows / Android projects.
Yes, it can be done that I have put some assets (audio files) in the core and Mainly used in the main I finally returned it as a byte array; I'm sure it can be played around to force it more.
Here is my code that I use
public byte [] GetApplicationResource (ApplicationResourceName resource name) {string resourcePath; Switch (resource name) {case ApplicationResourceName.AudioChord: sourcePath = AppConstants.ResourceNameAudioChord; break; Default: New ArgumentOutOfRangeException ("Resource Name") Throw; } Var assembly = Assembly. Gate contingency assembly (); (Var stream = assembly.GetManifestResourceStream (resourcePath)) // Check for discretion if (stream! = Null) {(var memoryStream = new MemoryStream ()) {stream.CopyTo (memoryStream); Return memory store Toure (); }}} Return tap; } Hopes
Comments
Post a Comment