简体   繁体   中英

Universal App - Mvvm light

m trying understand a MVVM pattern with MVVM Light Toolkit in Universal App. I've some question about this pattern.

  1. Should I write Views for Windows Phone and Windows separately or just one view in Shared project ?
  2. Should I use code behind only in Shared Project ?
  1. It depends on the requirements of the screen, if the views are different in windows phone and windows than write them in separately and share common resources between than using shared project resources. And if both are same then use shared project( which is rather sort of shared folder b/w both projects )

  2. All the business logic of the view and handling of the view should go to ViewModel. Thing that cannot be done properly in ViewModel should go to view code behind like starting and stopping of the story board etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM