microsoft / TemplateStudio

Template Studio accelerates the creation of new WinUI 3, WPF, and UWP apps using a wizard-based experience.
Other
2.72k stars 462 forks source link

Framework proposal: XPlat/Xam.Forms ready #229

Closed mrlacey closed 7 years ago

mrlacey commented 7 years ago

Something I'm starting to see a lot of is people who have built their first UWP app and then want to move over to create versions for Android and iOS. The promises of MVVM for code reuse and Xamarin.Forms for using XAML. The reality for these people is that even though they were trying to follow the MVVM pattern they've ended up with the different parts so tightly coupled that enabling reuse of their code to run on multiple platforms involves a major refactor. While not a major goal for this project I believe we should provide an option for people in (or likely to end up in) this position.

In my proposal, the generated solution would create multiple projects. One for the UWP app, and a platform agnostic class library for the (shared) Model and ViewModel layers. By removing the ability for the VM and M to reference UWP specifics they are more easily reusable on other platforms. This also makes them easier to test too. Probably to be based on MVVM Basic but with decoupling of the UWP specifics.

Obviously, a post v1.0 idea but wanted to get this down and gather some feedback.

mrlacey commented 7 years ago

Working on a PoC, will share soon. The intention is to make it easier to create ViewModels and Models in a separate library so they can be more easily reused. And also tested without taking a dependency on UWP.

mrlacey commented 7 years ago

Suggested this as a way to create something that could easily be extended to other platforms but as Xamarin support seems to be under way there will be no need for this.