Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

MVVM frameworks

4,579 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
  • Be the first to comment

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

×