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.

Dia 4.1 mvvm cross

1,016 views

Published on

Introduction to mvvm cross

Published in: Software
  • Be the first to comment

  • Be the first to like this

Dia 4.1 mvvm cross

  1. 1. ● MVVM ● MVVMCross Xamarin
  2. 2. MVVM Xamarin
  3. 3. MVVM Model-View-ViewModel Xamarin
  4. 4. Motivation: Development technologies like Windows Forms, WPF, Silverlight, and Windows Phone provide a default experience that leads a developer down the path of dragging controls from a toolbox to a design surface. Xamarin
  5. 5. Motivation: ● Writing code in the form's code-behind file. ● Coupling between the UI controls and the business logic. ● Increases the cost of making UI modifications. ● Difficulty of unit testing such code. Xamarin
  6. 6. Xamarin View The view is responsible for defining the structure, layout, and appearance of what the user sees on the screen
  7. 7. Xamarin Model The model in MVVM is an implementation of the application's domain model that includes a data model along with business and validation logic.
  8. 8. Xamarin ViewModel The view model acts as an intermediary between the view and the model, and is responsible for handling the view logic. Typically, the view model interacts with the model by invoking methods in the model classes.
  9. 9. Xamarin Benefits ● During the development process, developers and designers can work more independently and concurrently on their components. ● The developers can create unit tests for the view model and the model without using the view.
  10. 10. Xamarin Cons ● Overskill for simple ui operations.
  11. 11. Xamarin MVVM Cross ● https://mvvmcross.com/ ● https://github.com/mvvmcross/mvvmcross ● jonathanroux.com/2016/02/09/mvvmcross-4-and-xamarin-project-setup/ ● https://github.com/slodge
  12. 12. Xamarin The MvvmCross Magic It’s an open-source framework maintained by Stuart Lodge, Martijn van Dijk & Co. ● It has Dependency Injection built-in -> Interface Driven Design. ● It has a lot of plugins already written such as location, emails, gallery, network, SQLite, secure storage, phone calls etc. ● #IF plugins -> less work for the developer, but also less control.
  13. 13. Xamarin MvvmCross has support for: ● Xamarin.iOS ● Mac ● Xamarin.Android ● Windows Presentation Foundation ● Windows Phone ● Windows 8 ● Universal Windows Platform
  14. 14. Xamarin DataBindings: Window Phone -> Properties No C#, just XAML <TextBox Text="{Binding Password, Mode=TwoWay}" /> Android -> Properties No C#, just XML xmlns:local="http://schemas.android.com/apk/res-auto" <EditText local:MvxBind="Text Password" /> IOS -> Properties Just C# var set = this.CreateBindingSet<LoginViewController, LoginViewModel>(); set.Bind(textField_Password).To(vm => vm.Password);
  15. 15. Xamarin Vamos a ver un Video!
  16. 16. Xamarin
  17. 17. Xamarin Naaah! Mentira, eso lo miran en sus casa, acá va en vivo! Jaj! mirenlo.
  18. 18. Xamarin Presten atención! Vamos.
  19. 19. Muchas Gracias! Damián Pumar

×