lundi 23 novembre 2015

Why using Template 10 is a great idea in a Universal Application

Template10 is on Github

When you first install Visual Studio 2015 and want to start developing for windows 10 all you get an empty blank template...  which is not great.



At least in when we started developing for Windows 8.1 we had the option to start with different tempaltes:
  • Blank App
  • Hub App
  • Grid App
  • And more
As you can see here:



So why when we want to create a Windows Universal App in Visual Studio 2015 we only have a blank application template where is the love!!

Why did the Visual Studio Team do this to us?  did we do something wrong? I don't know... but I found a solution and this is where Jerry Nixon and the Github community comes in and try to give you a hand!

Template 10: https://github.com/Windows-XAML/Template10 is a Windows app project template that can help you speed up your development time!

Thanks to the great job of the community Template 10 allows us Universal application developers for Windows 10 to have a very nice starting base for your development and it also gives you conventions that you SHOULD follow =).

Here are the conventions that Template 10 uses:
  1. Views (XAML files) are located in an /Views folder (and ns)
  2. Only have one view-model for one view
  3. View-models are located in a /ViewModels folder (and ns)
  4. Use OnNavigatedTo in view-models, not pages
  5. Models are located in a /Models folder (and ns)
  6. Use the façade pattern with our models
  7. Navigate using a NavigationService
  8. Communicate with a Messenger
  9. Dependency Injection
  10. We use Template 10 ;-)
Help us make Template 10 more robust and help the Github community  by asking questions and contributing if you can!  I have recently done a pull request so that if you (like me) are migrating your existing application from a Windows Phone or Windows Store application that was using Mvvm Light, you can keep on using your current properties without having to add Mvvm Light to your project.   Because yes Template 10 does ship with a mini Mvvm Framework, that being said you should use your favorite Mvvm Framework.

I'll let you check out the Github repository: https://github.com/Windows-XAML/Template10
Or you can download the Visual Studio template here: https://visualstudiogallery.msdn.microsoft.com/60bb885a-44e9-4cbf-a380-270803b3f6e5



Thanks for reading.