MVVM frameworks

3,568 views
3,098 views

Published on

a bit about mvvm frameworks for WP8 and Windows Phone 8: Mvvm light, Caliburn.Micro, MvvmCross, Simple Mvvm

Published in: Software, Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,568
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
56
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

MVVM frameworks

  1. 1. MVVM FRAMEWORKS Egor Bogatov. Xamarin developer at Playtika.
  2. 2. Какие ваши преимущества? •Testability •Developer-designer workflow (blendability)
  3. 3. Is it popular?
  4. 4. Only for С#/XAML? •WPF / Silverlight / WP8 / Windows Store / WinForms / iOS / Android / MAC •JavaScript (Knockout, etc) •Java (ZK)
  5. 5. MVVM diagram
  6. 6. MVVM diagram - details
  7. 7. Typical MVVM Framework •BaseViewModel •ICommand implementations •Behaviors •ValueConverters •EventAggregator •IoC (ViewModelLocator) •Templates, snippets •“Donate” button
  8. 8. Popular MVVM Frameworks •MVVM Light •Caliburn.Micro •Simple MVVM •ReactiveUI •Catel •MvvmCross •…
  9. 9. MVVM Light •BaseViewModel •RelayCommand •Messanger Extra: •EventToCommand •SimpleIoc
  10. 10. Simple MVVM •AssociateProperties •AssociateProperties(m => m.FirstName, vm => vm.CustomerName); •ViewModelDetailBase •BeginEdit - Copy = Model.Clone() •CancelEdit - Model = Original; •EndEdit - Copy.CopyValuesTo(Original) •MessageBus •“Cross-platform”
  11. 11. Caliburn.Micro • MDD – Magic Driven Development
  12. 12. Caliburn.Micro: a bit more magic <Button Content="Let's Talk" cal:Message.Attach=" [Event MouseEnter] = [Action Talk('Hello', Name.Text)]; [Event MouseLeave] = [Action Talk('Goodbye', Name.Text)]" />
  13. 13. Caliburn.Micro: tombstone public class MainPageModelStorage: StorageHandler<MainPageViewModel> { public override void Configure() { Property(x => x.Name) .InAppSettings(); } }
  14. 14. Caliburn.Micro: navigation navigationService.UriFor<Page2ViewModel>() .WithParam(x => x.Name, "Test") .Navigate();
  15. 15. MvvmCross •Cross-platform •PCL ViewModels •Plugins
  16. 16. MvvmCross: navigation •%Name%ViewModel - %Name%View •ShowViewModel<FooViewModel>(new {key = “foo”})) FooViewModel: public void Init(string key) { }
  17. 17. MvvmCross: tombstone •LoadStateBundle •SaveStateBundle •bundle.Data[“Name”] = _name; •bundle.Data[“Id”] = _id;
  18. 18. MvvmCross: plugins •Accelerometer •Bookmarks •Color •DownloadCache •Email •File •Json •JsonLocalization •Location •Messenger •MethodBinding •Network •PhoneCall •PictureChooser •Reflection •ResourceLoader •Share •SoundEffects •Sqlite •ThreadUtils •Visibility •WebBrowser
  19. 19. Text binding
  20. 20. Command binding

×