I’m currently working on a crossplatform app targeting Windows Store Apps and WP8. For this project I’m using a Portable Class Library so I can share the code. I’m using MVVM pattern, the Model and the ViewModels are in the PCL, while the separate projects have only Views and Adapters(for the things that differ such as file access). I came across a scenario where I needed to access some resources in the PCL, and although I ended up resolving the code in the PCL itself, I realized quite a few are wondering how can you access files in the PCL from another project, so I’ve made a very simple example to show you how to do that. Basically we use reflection and embedded resources. Just remember that embedded resources cant be modified directly.
Set the document as embedded resource (IMPORTANT)
Add a reference to the PCL from the Windows Store App
Add The View
Create a Class to match the document. Hook into the resource in the PCL.
Run the App.