SlideShare a Scribd company logo
1 of 35
Hot Tuna
CROSS PLATFORM DEVELOPMENT WITH .NET, XAMARIN
AND MVVMCROSS
Sean’s Guff
Formerly CIO at Catalyst Risk Management
Currently unemployed
Personal shareware site at
www.sourceitsoftware.com
Blog at
sourceitsoftware.blogspot.com
@seanrcross

sean@sourceitsoftware.com
To cover
•What are we trying to achieve
•Example
•Theory (boring!)
•Getting started with MvvmCross
•Plugins
•Platform specific stuff

•Summary
•Links
The holy grail
What is achievable
Example – Lions Official (sorry)
The pieces
•.net (duh)

•Xamarin (iOS, Android, Mac)
•Portable Class Libraries
•MvvmCross
Xamarin
•Commercial products for C# development for non-Windows platforms
•Xamarin.Android
•Xamarin.iOS
•Xamarin.Mac
•Need business edition for VS integration @ $999 US each
Xamarin Demo
Portable Class Libraries
•Create a single library that can be used by multiple .net frameworks
•Allows access only to functionality shared by all selected frameworks
•Does some nifty namespace mapping
•Makes cross platform development much easier
•Microsoft and 3rd party PCLs available (HttpClient, Imaging, JSON…)
.net x.x

Silverlight

Portable Class
Library
Shared
functionality
.net x.x

Silverlight

Portable Class
Library
Shared
functionality

Windows Store
.net x.x

Silverlight

Portable Class
Library
Shared
functionality

Windows Store

Xamarin.XXXX
PCL Demo
Easy-peasy, lemon squeezy
It’s hard to find a good image of a class library
Mvvm: Model – View Model - Model
Mvvm: Key interfaces
•INotifyPropertyChanged
• RaisePropertyChanged(() => PropertyName );

•ICommand

•INotifyCollectionChanged (or ObservableCollection)
Mvvm: Binding
XAML
<StackPanel>
<TextBox Text="{Binding Hello, Mode=TwoWay}" />
<TextBlock Text="{Binding Hello}" />
<Button Content="Click Me" Command="{Binding MyCommand}" />
<Button Content="Go Second"
Command="{Binding GoSecondCommand}"
/>
</StackPanel>

Code
public class FirstViewModel
: MvxViewModel
{
private string _hello = "Hello MvvmCross";
public string Hello
{
get { return _hello; }
set { _hello = value; RaisePropertyChanged(() => Hello); }
}
public System.Windows.Input.ICommand MyCommand
{
get
{
return new Cirrious.MvvmCross.ViewModels.MvxCommand(DoMyCommand);
}
}
private void DoMyCommand()
{
Hello = Hello + " World";
}
public System.Windows.Input.ICommand GoSecondCommand
{
get
{
return new Cirrious.MvvmCross.ViewModels.MvxCommand(DoGoSecond);
}
}
private void DoGoSecond()
{
ShowViewModel<SecondViewModel>();
}
}
MvvmCross
•Cross Platform MVVM Development Framework
•Free, open source
•Supports
•
•
•
•
•
•

WP7,8
WPF
WinRT
Xamarin.Android
Xamarin.iOS
Xamarin.Mac

•AKA Mvx
MvvmCross Architecture
Using MvvmCross
•Hard

-

download from github, compile, include references etc

•Easy

-

Nuget; look for MvvmCross Hot Tuna Starter Pack, and plugins

•Real Easy

-

NinjaCoder
Getting started - Nuget
Getting started - NinjaCoder
Plugins
•Convenient way to access platform functionality
•Use NinjaCoder or Nuget to add plugins
•Includes Accelerometer, Email, Files, Location, Messaging, Sqlite
•3rd party plugins available as well.
•Consume plugins using Dependency Injection or Service locator
Plugins Demo
Platform specific code
•Describe functionality using an interface in .Core
•Create platform specific implementation in .xxxx
•Register implementation on app startup
◦ Mvx.RegisterSingleton<ISettingsPersistance>(new SettingsPersistanceWPF());
◦ Mvx.RegisterType<IGetRemoteData, RemoteDataWpf>();

•Consume plugins using Dependancy Injection or Service locator
• persistance = Mvx.Resolve<ISettingsPersistance>();
Platform specific example
•Here is one that I prepared earlier
Summary
•PCLs let you use easily share code across multiple platforms
•Xamarin lets you use C# on Android, iOS and Mac
•MvvmCross wraps it all up to make it easy
• Shared PCL that holds most functionality
• Platform specific apps for views and dependant code

•Plugins let you easily add functionality in a cross platform friendly way
•Do your own platform dependant stuff using interfaces and IoC/Dependancy Injection
Links - MvvmCross
Stuart Lodge - MvvmCross Author
•Twitter

@slodge

•Blog

http://slodge.blogspot.co.uk/

•Videos

http://www.youtube.com/user/MrHollywoof?feature=watch

•List of tutorial videos

http://mvvmcross.wordpress.com/

•Repository

https://github.com/slodge/MvvmCross
Links - Xamarin
•Website -

http://www.xamarin.com/

•Samples -

https://github.com/xamarin

•Mobile library - https://github.com/xamarin/Xamarin.Mobile
Links – Ninja Coder
•Adrian Sudbury – Ninja Coder Author
•Twitter

@asudbury

•Blog

http://adriansudbury.blogspot.co.uk/

•Ninja Coder

http://visualstudiogallery.msdn.microsoft.com/618b51f0-6de8-4f85-95ce-a50c658c7767
Links - Other
http://www.hanselman.com/blog/CrossPlatformPortableClassLibrariesWithNETAreHappening.aspx
http://sourceitsoftware.blogspot.co.nz/
Credits
Mvvm Images from http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/MVVM
Questions
•Answers not guaranteed

More Related Content

What's hot

Building Buzzword (Flex Camp Boston 2007)
Building Buzzword (Flex Camp Boston 2007)Building Buzzword (Flex Camp Boston 2007)
Building Buzzword (Flex Camp Boston 2007)
dcoletta
 
NodeJS_Presentation
NodeJS_PresentationNodeJS_Presentation
NodeJS_Presentation
Arpita Patel
 

What's hot (20)

WebAssembly and .NET
WebAssembly and .NETWebAssembly and .NET
WebAssembly and .NET
 
Vm_Commit or How to Easily Handle An Infinite Number of Versions of Running Q...
Vm_Commit or How to Easily Handle An Infinite Number of Versions of Running Q...Vm_Commit or How to Easily Handle An Infinite Number of Versions of Running Q...
Vm_Commit or How to Easily Handle An Infinite Number of Versions of Running Q...
 
MSDN Live: Silverlight 2
MSDN Live: Silverlight 2MSDN Live: Silverlight 2
MSDN Live: Silverlight 2
 
Whats new in .net core 3
Whats new in .net core 3Whats new in .net core 3
Whats new in .net core 3
 
engage 2016 - Get ready for moving from Java 6 to Java 8 - Now!
engage 2016 - Get ready for moving from Java 6 to Java 8 - Now!engage 2016 - Get ready for moving from Java 6 to Java 8 - Now!
engage 2016 - Get ready for moving from Java 6 to Java 8 - Now!
 
NWJS. Web on desktop
NWJS. Web on desktopNWJS. Web on desktop
NWJS. Web on desktop
 
ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!
 
Building Buzzword (Flex Camp Boston 2007)
Building Buzzword (Flex Camp Boston 2007)Building Buzzword (Flex Camp Boston 2007)
Building Buzzword (Flex Camp Boston 2007)
 
Cross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreCross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet core
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
Mean stack
Mean stackMean stack
Mean stack
 
Web Assembly Big Picture
Web Assembly Big PictureWeb Assembly Big Picture
Web Assembly Big Picture
 
First Step towards WebAssembly with Rust
First Step towards WebAssembly with RustFirst Step towards WebAssembly with Rust
First Step towards WebAssembly with Rust
 
.NET Core on Mac
.NET Core on Mac.NET Core on Mac
.NET Core on Mac
 
NodeJS_Presentation
NodeJS_PresentationNodeJS_Presentation
NodeJS_Presentation
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
.Net Core
.Net Core.Net Core
.Net Core
 
Vertx in production
Vertx in productionVertx in production
Vertx in production
 
Feature Based Web Development with Bazaar
Feature Based Web Development with BazaarFeature Based Web Development with Bazaar
Feature Based Web Development with Bazaar
 

Similar to Hot tuna - from Sean Cross

Open source and cross platform .net
Open source and cross platform .netOpen source and cross platform .net
Open source and cross platform .net
Ibon Landa
 
Docker intro
Docker introDocker intro
Docker intro
spiddy
 
Apache Continuum Build, Test, and Release
Apache Continuum Build, Test, and ReleaseApache Continuum Build, Test, and Release
Apache Continuum Build, Test, and Release
elliando dias
 
Benefits of an Open environment with Wakanda
Benefits of an Open environment with WakandaBenefits of an Open environment with Wakanda
Benefits of an Open environment with Wakanda
Alexandre Morgaut
 

Similar to Hot tuna - from Sean Cross (20)

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
 
Highlights from the Xamarin Evolve 2016 conference
Highlights from the Xamarin Evolve 2016 conferenceHighlights from the Xamarin Evolve 2016 conference
Highlights from the Xamarin Evolve 2016 conference
 
DevOps Unleashed: Strategies that Speed Deployments
DevOps Unleashed: Strategies that Speed DeploymentsDevOps Unleashed: Strategies that Speed Deployments
DevOps Unleashed: Strategies that Speed Deployments
 
Do you lose sleep at night?
Do you lose sleep at night?Do you lose sleep at night?
Do you lose sleep at night?
 
Open source and cross platform .net
Open source and cross platform .netOpen source and cross platform .net
Open source and cross platform .net
 
Cloud Native Camel Riding
Cloud Native Camel RidingCloud Native Camel Riding
Cloud Native Camel Riding
 
Visual studio + Xamarin == Love
Visual studio + Xamarin == LoveVisual studio + Xamarin == Love
Visual studio + Xamarin == Love
 
Docker intro
Docker introDocker intro
Docker intro
 
Apache Continuum Build, Test, and Release
Apache Continuum Build, Test, and ReleaseApache Continuum Build, Test, and Release
Apache Continuum Build, Test, and Release
 
PUG Challenge 2016 - The nativescript pug app challenge
PUG Challenge 2016 -  The nativescript pug app challengePUG Challenge 2016 -  The nativescript pug app challenge
PUG Challenge 2016 - The nativescript pug app challenge
 
321 codeincontainer brewbox
321 codeincontainer brewbox321 codeincontainer brewbox
321 codeincontainer brewbox
 
NIC - Windows Azure Pack - Level 300
NIC - Windows Azure Pack - Level 300NIC - Windows Azure Pack - Level 300
NIC - Windows Azure Pack - Level 300
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Blazor - The New Silverlight?
Blazor - The New Silverlight?Blazor - The New Silverlight?
Blazor - The New Silverlight?
 
Why you should be using Aegir: The Drupal-oriented hosting system
Why you should be using Aegir: The Drupal-oriented hosting systemWhy you should be using Aegir: The Drupal-oriented hosting system
Why you should be using Aegir: The Drupal-oriented hosting system
 
Visual studio + Xamarin equals love
Visual studio + Xamarin equals loveVisual studio + Xamarin equals love
Visual studio + Xamarin equals love
 
Benefits of an Open environment with Wakanda
Benefits of an Open environment with WakandaBenefits of an Open environment with Wakanda
Benefits of an Open environment with Wakanda
 
Real World Windows Phone Development
Real World Windows Phone DevelopmentReal World Windows Phone Development
Real World Windows Phone Development
 
Using Packer to Migrate XenServer Infrastructure to CloudStack
Using Packer to Migrate XenServer Infrastructure to CloudStackUsing Packer to Migrate XenServer Infrastructure to CloudStack
Using Packer to Migrate XenServer Infrastructure to CloudStack
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 

More from Stuart Lodge

MvvmCross Introduction
MvvmCross IntroductionMvvmCross Introduction
MvvmCross Introduction
Stuart Lodge
 
Ui testing for Windows Phone
Ui testing for Windows PhoneUi testing for Windows Phone
Ui testing for Windows Phone
Stuart Lodge
 
Ui Testing on Windows Phone
Ui Testing on Windows PhoneUi Testing on Windows Phone
Ui Testing on Windows Phone
Stuart Lodge
 
Uk Nuke Facebook Connect Authentication For Dot Net Nuke
Uk Nuke Facebook Connect Authentication For Dot Net NukeUk Nuke Facebook Connect Authentication For Dot Net Nuke
Uk Nuke Facebook Connect Authentication For Dot Net Nuke
Stuart Lodge
 

More from Stuart Lodge (18)

Helping the Lions Roar
Helping the Lions RoarHelping the Lions Roar
Helping the Lions Roar
 
MvvmCross Introduction
MvvmCross IntroductionMvvmCross Introduction
MvvmCross Introduction
 
Wpug meeting - wp to win8 experiences
Wpug meeting - wp to win8 experiencesWpug meeting - wp to win8 experiences
Wpug meeting - wp to win8 experiences
 
AlphaLabs - Node Garden with Speech
AlphaLabs - Node Garden with Speech AlphaLabs - Node Garden with Speech
AlphaLabs - Node Garden with Speech
 
About Cirrious ltd
About Cirrious ltdAbout Cirrious ltd
About Cirrious ltd
 
C# Client to Cloud
C# Client to CloudC# Client to Cloud
C# Client to Cloud
 
How to make a pig udf
How to make a pig udfHow to make a pig udf
How to make a pig udf
 
C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)
C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)
C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)
 
Mvvm cross – going portable
Mvvm cross – going portableMvvm cross – going portable
Mvvm cross – going portable
 
Dev evening - MonoTouch, MonoDroid, Mvvm MvvmCross and databinding
Dev evening - MonoTouch, MonoDroid, Mvvm MvvmCross and databindingDev evening - MonoTouch, MonoDroid, Mvvm MvvmCross and databinding
Dev evening - MonoTouch, MonoDroid, Mvvm MvvmCross and databinding
 
Wpug mvvm and data binding
Wpug   mvvm and data bindingWpug   mvvm and data binding
Wpug mvvm and data binding
 
Ui testing for Windows Phone
Ui testing for Windows PhoneUi testing for Windows Phone
Ui testing for Windows Phone
 
Ui Testing on Windows Phone
Ui Testing on Windows PhoneUi Testing on Windows Phone
Ui Testing on Windows Phone
 
How To use Map Blogs
How To use Map BlogsHow To use Map Blogs
How To use Map Blogs
 
Uk Nuke Rpx Authentication For Dot Net Nuke
Uk Nuke Rpx Authentication For Dot Net NukeUk Nuke Rpx Authentication For Dot Net Nuke
Uk Nuke Rpx Authentication For Dot Net Nuke
 
Uk Nuke Facebook Connect Authentication For Dot Net Nuke
Uk Nuke Facebook Connect Authentication For Dot Net NukeUk Nuke Facebook Connect Authentication For Dot Net Nuke
Uk Nuke Facebook Connect Authentication For Dot Net Nuke
 
UkNuke Facebook Connect Authentication For DotNetNuke 5
UkNuke Facebook Connect Authentication For DotNetNuke 5UkNuke Facebook Connect Authentication For DotNetNuke 5
UkNuke Facebook Connect Authentication For DotNetNuke 5
 
10 things I’ve learnt In the clouds
10 things I’ve learnt In the clouds10 things I’ve learnt In the clouds
10 things I’ve learnt In the clouds
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 

Hot tuna - from Sean Cross

Editor's Notes

  1. Phone gap
  2. Model-View-ViewModel (MVVM) pattern splits the User Interface code into 3 conceptual parts - Model, View and ViewModel Model is a set of classes representing the data coming from the services or the database. View is the code corresponding to the visual representation of the data the way it is seen and interacted with by the user. ViewModel serves as the glue between the View and the Model. It wraps the data from the Model and makes it friendly for being presented and modified by the view. ViewModel also controls the View&apos;s interactions with the rest of the application (including any other Views).
  3. Any object that you want to bind in the View (e.g. the ViewModel, and any objects that the VM exposes) need to implement INotifyPropertyChanged. The base VM object normally implements a RaisePropertyChanged method that you call whenever you want to notify the View that a property has changed.Text fields etc on the View are bound to properties on the ViewModelButtons and actions are bound to ICommand propertiesLists are bound to a collection implementing INotifyCollectionChanged , oftenObservableCollection
  4. What is says on the boxSpecifically designed for cross platform