SlideShare une entreprise Scribd logo
1  sur  30
Xamarin & MvvmCross
in depth
Nicolas Milcoff (aka @nmilcoff)
Microsoft MVP - MvvmCross Maintainer
Agenda
▣ MVVM pattern recap
▣ Why to use an Open Source MVVM framework?
▣ MvvmCross
▣ Framework goodies
▣ Demos
▣ Q & A
The MVVM Pattern
MVVM benefits
▣ Highly decoupled components
▣ Code sharing ++
▣ Scalability
▣ Working in parallel made easy
▣ Stable and proven pattern
Open Source (MVVM) Frameworks
▣ Abstractions discussions --
▣ Barriers for new developers --
▣ Requirements focus ++
▣ Time saving ++
▣ Inputs from multiple developers / teams ++
App development
without compromise
MvvmCross
Supported Platforms
▣ Xamarin.Android, Xamarin.iOS
▣ Xamarin.Mac, Xamarin.tvOS
▣ UWP, WPF
▣ Tizen (WIP)
▣ Console!
▣ Xamarin.Forms
Features in a nutshell
▣ ViewModel first Navigation
▣ Data Bindings, Commands and Converters
▣ IoC Container / DI engine
▣ Platform specific widgets
▣ Unit Test Helpers
▣ Plugins
▣ Complete flexibility!
ViewModels
▣ Implement INotifyPropertyChanged
▣ Lifecycle:
□ void Prepare(MyObject parameter)
□ Task Initialize()
□ void Appearing(), void Appeared()
□ void Dissapearing(), void Dissapeared()
□ void ViewDestroyed()
□ void SaveStateToBundle(IMvxBundle bundle)
□ void ReloadFromBundle(IMvxBundle bundle)
Navigation in MvvmCross
Navigation in MvvmCross
▣ All logic remains in the shared code
▣ ViewPresenters for each platform
▣ Presentation attributes for declaration
▣ Presentation Hints for behavior
▣ 100% customizable
Navigation in MvvmCross
public class RootViewModel : MvxViewModel
{
private readonly IMvxNavigationService _navigationService;
public RootViewModel(IMvxNavigationService navigationService)
{
_navigationService = navigationService;
}
private async Task OpenModalAsync()
{
await _navigationService.Navigate<ModalViewModel>();
}
}
Navigation in MvvmCross
[MvxContentPagePresentation(WrapInNavigationPage = true)]
public partial class RootPage : MvxContentPage<RootViewModel>
{
// your code
}
[MvxModalPresentation]
public partial class ModalPage :
MvxContentPage<ModalViewModel>
{
// your code
}
DEMO!
Navigation & ViewPresenters
Data Bindings in MvvmCross
▣ Support for .cs, .xml, .axml, .xaml
▣ Value Converters
▣ Value Combiners
▣ OneWay, TwoWay, OneWayToSource, OneTime
▣ Multiple syntaxes
▣ Support for custom bindings
Data Bindings in MvvmCross
▣ Bindings in .axml (Tibet):
local:mvxBind=“Text MyTextProperty”
local:mvxBind=“Click MyAwesomeCommand”
local:mvxBind=“Checked Inverse(Prop), Mode=TwoWay,
Fallback=False”
Data Bindings in MvvmCross
▣ Bindings in xaml (Tibet):
mvx:Bi.nd="Text MyTextProperty”
mvx:Bi.nd=“Click MyAwesomeCommand”
mvx:Bi.nd=“Checked Inverse(Prop), Mode=TwoWay,
Fallback=False”
Data Bindings in MvvmCross
▣ Bindings in .cs (Fluent):
set.Bind(MyLabel).For(v => v.Text).To(vm => vm.MyProperty);
set.Bind(MyButton).To(vm => vm.MyAwesomeCommand);
set.Bind(MySwitch)
.For(v => v.On)
.To(vm => vm.Prop)
.WithConversion<InverseConverter>()
.WithFallback(false);
DEMO!
Data Binding
IoC Container and DI engine
▣ It’s optional
▣ Service Locator / IoC
▣ Constructor and Property Dependency Injection
▣ Singletons, dynamics, Open Generics, Child
Containers
▣ Bulk registrations
▣ What if I prefer to use $Lib$ instead? Also possible!
IoC Container and DI engine
Source: https://xamarinhelp.com/ioc-container-performance/
DEMO!
IoC Container / DI Engine
Platform specifics
▣ Support for Android.Support packages
▣ Polymorphic lists made easy
▣ Support for background services / push
notifications
▣ iOS Side Menu
▣ Abstraction plugins for most common features
Plugins
▣ Small code pieces that resolve specific situations
▣ Install from NuGet -> Run
▣ Official Plugins: Accelerometer, Visibility, Json,
Color, Localization, Messenger, Email, …
▣ Loads of 3rd party plugins
DEMO!
Plugins
Resources & Documentation
mvvmcross.com
Where our official
documentation lives
github.com/MvvmCross
Official samples and
source code
Slack
xamarinchat.herokuapp.
com. Then join
#mvvmcross
StackOverflow
Ask using the
#mvvmcross tag
Xamarin Forums
Use the official forums
Twitter
Follow and don’t
hesitate to contact
influencers
Get involved!
Support us on
OpenCollective
Contribute on
GitHub
Blog about your
experiences
Use the framework
in your apps
Questions?
Thanks!
Nico Milcoff
@nmilcoff
nicolas.milcoff@d-genix.com

Contenu connexe

Tendances

What the heck is a Umbraco property editor value converter?
What the heck is a Umbraco property editor value converter?What the heck is a Umbraco property editor value converter?
What the heck is a Umbraco property editor value converter?
Jeavon Leopold
 
Virtualizing MongoDB: Cloud, EC2, OpenStack, VMs...or Dedicated?
Virtualizing MongoDB: Cloud, EC2, OpenStack, VMs...or Dedicated?Virtualizing MongoDB: Cloud, EC2, OpenStack, VMs...or Dedicated?
Virtualizing MongoDB: Cloud, EC2, OpenStack, VMs...or Dedicated?
MongoDB
 
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
Tom Croucher
 
Rocking mongo db on the cloud
Rocking mongo db on the cloudRocking mongo db on the cloud
Rocking mongo db on the cloud
MongoDB
 
An Introduction to node.js
An Introduction to node.jsAn Introduction to node.js
An Introduction to node.js
nodejsbcn
 

Tendances (20)

Deploying Rails on EC2 using Rubber (Slides Only)
Deploying Rails on EC2 using Rubber (Slides Only)Deploying Rails on EC2 using Rubber (Slides Only)
Deploying Rails on EC2 using Rubber (Slides Only)
 
Mo' servers Mo' problems: Using containers at GetPantheon.com
Mo' servers Mo' problems: Using containers at GetPantheon.comMo' servers Mo' problems: Using containers at GetPantheon.com
Mo' servers Mo' problems: Using containers at GetPantheon.com
 
What the heck is a Umbraco property editor value converter?
What the heck is a Umbraco property editor value converter?What the heck is a Umbraco property editor value converter?
What the heck is a Umbraco property editor value converter?
 
WordPress Meetup at HUBBA Thailand
WordPress Meetup at HUBBA ThailandWordPress Meetup at HUBBA Thailand
WordPress Meetup at HUBBA Thailand
 
WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?
 
Virtualizing MongoDB: Cloud, EC2, OpenStack, VMs...or Dedicated?
Virtualizing MongoDB: Cloud, EC2, OpenStack, VMs...or Dedicated?Virtualizing MongoDB: Cloud, EC2, OpenStack, VMs...or Dedicated?
Virtualizing MongoDB: Cloud, EC2, OpenStack, VMs...or Dedicated?
 
Build App with Nodejs - YWC Workshop
Build App with Nodejs - YWC WorkshopBuild App with Nodejs - YWC Workshop
Build App with Nodejs - YWC Workshop
 
WebAssembly in Houdini CSS, is it possible?
WebAssembly in Houdini CSS, is it possible?WebAssembly in Houdini CSS, is it possible?
WebAssembly in Houdini CSS, is it possible?
 
The Evolution Of JavaScript
The Evolution Of JavaScriptThe Evolution Of JavaScript
The Evolution Of JavaScript
 
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
 
Create a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDBCreate a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDB
 
Rocking mongo db on the cloud
Rocking mongo db on the cloudRocking mongo db on the cloud
Rocking mongo db on the cloud
 
Knock out Introduction with samples (jsfiddle.net)
Knock out Introduction with samples (jsfiddle.net)Knock out Introduction with samples (jsfiddle.net)
Knock out Introduction with samples (jsfiddle.net)
 
Wordpress -> Middleman: Lesson learned in the 2-years since migrating
Wordpress -> Middleman: Lesson learned in the 2-years since migratingWordpress -> Middleman: Lesson learned in the 2-years since migrating
Wordpress -> Middleman: Lesson learned in the 2-years since migrating
 
Node intro
Node introNode intro
Node intro
 
Server Side Apocalypse, JS
Server Side Apocalypse, JSServer Side Apocalypse, JS
Server Side Apocalypse, JS
 
Extreme Javascript Minification
Extreme Javascript MinificationExtreme Javascript Minification
Extreme Javascript Minification
 
An Introduction to node.js
An Introduction to node.jsAn Introduction to node.js
An Introduction to node.js
 
Node.js rulz! JavaScript takes over the full Stack
Node.js rulz! JavaScript takes over the full StackNode.js rulz! JavaScript takes over the full Stack
Node.js rulz! JavaScript takes over the full Stack
 
MongoDB + Node.JS + EPAM ROAD
MongoDB + Node.JS + EPAM ROADMongoDB + Node.JS + EPAM ROAD
MongoDB + Node.JS + EPAM ROAD
 

Similaire à Xamarin & MvvmCross in depth

Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?
glynnormington
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
Andrea Verlicchi
 

Similaire à Xamarin & MvvmCross in depth (20)

MVP Mix 2015 Leveraging MVVM on all Platforms
MVP Mix 2015  Leveraging MVVM on all PlatformsMVP Mix 2015  Leveraging MVVM on all Platforms
MVP Mix 2015 Leveraging MVVM on all Platforms
 
Is OSGi Modularity Always Worth It? - Glyn Normington
Is OSGi Modularity Always Worth It? - Glyn NormingtonIs OSGi Modularity Always Worth It? - Glyn Normington
Is OSGi Modularity Always Worth It? - Glyn Normington
 
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
 
Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
 
Geographically Distributed Multi-Master MySQL Clusters
Geographically Distributed Multi-Master MySQL ClustersGeographically Distributed Multi-Master MySQL Clusters
Geographically Distributed Multi-Master MySQL Clusters
 
Planning to Fail #phpne13
Planning to Fail #phpne13Planning to Fail #phpne13
Planning to Fail #phpne13
 
Born in the Cloud, Built like a Startup
Born in the Cloud, Built like a StartupBorn in the Cloud, Built like a Startup
Born in the Cloud, Built like a Startup
 
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..
 
Day 4 - Cloud Migration - But How?
Day 4 - Cloud Migration - But How?Day 4 - Cloud Migration - But How?
Day 4 - Cloud Migration - But How?
 
Planning to Fail #phpuk13
Planning to Fail #phpuk13Planning to Fail #phpuk13
Planning to Fail #phpuk13
 
Automating the Entire PostgreSQL Lifecycle
Automating the Entire PostgreSQL Lifecycle Automating the Entire PostgreSQL Lifecycle
Automating the Entire PostgreSQL Lifecycle
 
Wcf Overview
Wcf OverviewWcf Overview
Wcf Overview
 
Advanced #6 clean architecture
Advanced #6  clean architectureAdvanced #6  clean architecture
Advanced #6 clean architecture
 
Loadbalancers: The fabric for your micro services
Loadbalancers: The fabric for your micro servicesLoadbalancers: The fabric for your micro services
Loadbalancers: The fabric for your micro services
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLST
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java edition
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 

Plus de Nicolas Milcoff

Plus de Nicolas Milcoff (11)

Mobile security recipes for xamarin
Mobile security recipes for xamarinMobile security recipes for xamarin
Mobile security recipes for xamarin
 
Mobile dev ops demystified
Mobile dev ops demystifiedMobile dev ops demystified
Mobile dev ops demystified
 
GraphQL en .NET
GraphQL en .NETGraphQL en .NET
GraphQL en .NET
 
Visual Studio App Center: Nuestro centro de operaciones
Visual Studio App Center: Nuestro centro de operacionesVisual Studio App Center: Nuestro centro de operaciones
Visual Studio App Center: Nuestro centro de operaciones
 
Desarrolla tu próxima app con Xamarin & MvvmCross
Desarrolla tu próxima app con Xamarin & MvvmCrossDesarrolla tu próxima app con Xamarin & MvvmCross
Desarrolla tu próxima app con Xamarin & MvvmCross
 
Guia de supervivencia mobile para el desarrollador .NET
Guia de supervivencia mobile para el desarrollador .NETGuia de supervivencia mobile para el desarrollador .NET
Guia de supervivencia mobile para el desarrollador .NET
 
Build your next app with MvvmCross 6
Build your next app with MvvmCross 6Build your next app with MvvmCross 6
Build your next app with MvvmCross 6
 
Tech Day Rosario 2017: Open Source for the win!
Tech Day Rosario 2017: Open Source for the win!Tech Day Rosario 2017: Open Source for the win!
Tech Day Rosario 2017: Open Source for the win!
 
Open Source for the win!
Open Source for the win!Open Source for the win!
Open Source for the win!
 
ViewPresenters in MvvmCross
ViewPresenters in MvvmCrossViewPresenters in MvvmCross
ViewPresenters in MvvmCross
 
Going pixel perfect with Xamarin and MvvmCross
Going pixel perfect with Xamarin and MvvmCrossGoing pixel perfect with Xamarin and MvvmCross
Going pixel perfect with Xamarin and MvvmCross
 

Dernier

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 

Xamarin & MvvmCross in depth

  • 1. Xamarin & MvvmCross in depth Nicolas Milcoff (aka @nmilcoff) Microsoft MVP - MvvmCross Maintainer
  • 2. Agenda ▣ MVVM pattern recap ▣ Why to use an Open Source MVVM framework? ▣ MvvmCross ▣ Framework goodies ▣ Demos ▣ Q & A
  • 4. MVVM benefits ▣ Highly decoupled components ▣ Code sharing ++ ▣ Scalability ▣ Working in parallel made easy ▣ Stable and proven pattern
  • 5. Open Source (MVVM) Frameworks ▣ Abstractions discussions -- ▣ Barriers for new developers -- ▣ Requirements focus ++ ▣ Time saving ++ ▣ Inputs from multiple developers / teams ++
  • 8. Supported Platforms ▣ Xamarin.Android, Xamarin.iOS ▣ Xamarin.Mac, Xamarin.tvOS ▣ UWP, WPF ▣ Tizen (WIP) ▣ Console! ▣ Xamarin.Forms
  • 9. Features in a nutshell ▣ ViewModel first Navigation ▣ Data Bindings, Commands and Converters ▣ IoC Container / DI engine ▣ Platform specific widgets ▣ Unit Test Helpers ▣ Plugins ▣ Complete flexibility!
  • 10. ViewModels ▣ Implement INotifyPropertyChanged ▣ Lifecycle: □ void Prepare(MyObject parameter) □ Task Initialize() □ void Appearing(), void Appeared() □ void Dissapearing(), void Dissapeared() □ void ViewDestroyed() □ void SaveStateToBundle(IMvxBundle bundle) □ void ReloadFromBundle(IMvxBundle bundle)
  • 12. Navigation in MvvmCross ▣ All logic remains in the shared code ▣ ViewPresenters for each platform ▣ Presentation attributes for declaration ▣ Presentation Hints for behavior ▣ 100% customizable
  • 13. Navigation in MvvmCross public class RootViewModel : MvxViewModel { private readonly IMvxNavigationService _navigationService; public RootViewModel(IMvxNavigationService navigationService) { _navigationService = navigationService; } private async Task OpenModalAsync() { await _navigationService.Navigate<ModalViewModel>(); } }
  • 14. Navigation in MvvmCross [MvxContentPagePresentation(WrapInNavigationPage = true)] public partial class RootPage : MvxContentPage<RootViewModel> { // your code } [MvxModalPresentation] public partial class ModalPage : MvxContentPage<ModalViewModel> { // your code }
  • 16. Data Bindings in MvvmCross ▣ Support for .cs, .xml, .axml, .xaml ▣ Value Converters ▣ Value Combiners ▣ OneWay, TwoWay, OneWayToSource, OneTime ▣ Multiple syntaxes ▣ Support for custom bindings
  • 17. Data Bindings in MvvmCross ▣ Bindings in .axml (Tibet): local:mvxBind=“Text MyTextProperty” local:mvxBind=“Click MyAwesomeCommand” local:mvxBind=“Checked Inverse(Prop), Mode=TwoWay, Fallback=False”
  • 18. Data Bindings in MvvmCross ▣ Bindings in xaml (Tibet): mvx:Bi.nd="Text MyTextProperty” mvx:Bi.nd=“Click MyAwesomeCommand” mvx:Bi.nd=“Checked Inverse(Prop), Mode=TwoWay, Fallback=False”
  • 19. Data Bindings in MvvmCross ▣ Bindings in .cs (Fluent): set.Bind(MyLabel).For(v => v.Text).To(vm => vm.MyProperty); set.Bind(MyButton).To(vm => vm.MyAwesomeCommand); set.Bind(MySwitch) .For(v => v.On) .To(vm => vm.Prop) .WithConversion<InverseConverter>() .WithFallback(false);
  • 21. IoC Container and DI engine ▣ It’s optional ▣ Service Locator / IoC ▣ Constructor and Property Dependency Injection ▣ Singletons, dynamics, Open Generics, Child Containers ▣ Bulk registrations ▣ What if I prefer to use $Lib$ instead? Also possible!
  • 22. IoC Container and DI engine Source: https://xamarinhelp.com/ioc-container-performance/
  • 24. Platform specifics ▣ Support for Android.Support packages ▣ Polymorphic lists made easy ▣ Support for background services / push notifications ▣ iOS Side Menu ▣ Abstraction plugins for most common features
  • 25. Plugins ▣ Small code pieces that resolve specific situations ▣ Install from NuGet -> Run ▣ Official Plugins: Accelerometer, Visibility, Json, Color, Localization, Messenger, Email, … ▣ Loads of 3rd party plugins
  • 27. Resources & Documentation mvvmcross.com Where our official documentation lives github.com/MvvmCross Official samples and source code Slack xamarinchat.herokuapp. com. Then join #mvvmcross StackOverflow Ask using the #mvvmcross tag Xamarin Forums Use the official forums Twitter Follow and don’t hesitate to contact influencers
  • 28. Get involved! Support us on OpenCollective Contribute on GitHub Blog about your experiences Use the framework in your apps