I have an existing universal app targeting Windows 8.1 and Windows Phone 8.1.
I now want to create a Windows 10 version of the app. But I still want to maintain the existing Windows 8.1 and Windows Phone apps.
Can I share code between the (old) universal 8.1 app and the Windows Universal App?
I imagine a project structure like this:
Currently I have:
I would like to add another project for Windows 10:
With a reference to the existing Shared project.
Is that a feasible approach? Or what would be a better approach?
Yes, you can do that. Add the Universal Windows project to your existing solution, select Add References... from either the Project menu or by right clicking on the Project's References folder in the Solution Explorer, then add App.Shared from the Reference Manager's Shared Projects section.
You'll need to make sure that the shared files are all valid in both contexts or use conditional compilation to separate out the differences.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With