Download presentation
Presentation is loading. Please wait.
Published byPhyllis Berry Modified over 9 years ago
1
Hot Tuna CROSS PLATFORM DEVELOPMENT WITH.NET, XAMARIN AND MVVMCROSS
2
Sean’s Guff Formerly CIO at Catalyst Risk Management Currently unemployed Personal shareware site at www.sourceitsoftware.com www.sourceitsoftware.com Blog at sourceitsoftware.blogspot.com sourceitsoftware.blogspot.com @seanrcross sean@sourceitsoftware.com
3
To cover What are we trying to achieve Example Theory (boring!) Getting started with MvvmCross Plugins Platform specific stuff Summary Links
4
The holy grail
5
What is achievable
6
Example – Lions Official (sorry)
8
The pieces. net (duh) Xamarin (iOS, Android, Mac) Portable Class Libraries MvvmCross
9
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
10
Xamarin Demo
11
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 3 rd party PCLs available (HttpClient, Imaging, JSON…)
12
.net x.x Portable Class Library Shared functionality Silverlight
13
.net x.x Windows Store Portable Class Library Shared functionality Silverlight
14
.net x.x Windows Store Portable Class Library Shared functionality Silverlight Xamarin.XXXX
15
PCL Demo Easy-peasy, lemon squeezy It’s hard to find a good image of a class library
16
Mvvm: Model – View Model - Model
17
Mvvm: Key interfaces INotifyPropertyChanged RaisePropertyChanged(() => PropertyName ); ICommand INotifyCollectionChanged (or ObservableCollection)
18
Mvvm: Binding
19
XAML Code <Button Content="Go Second" Command="{Binding GoSecondCommand}" /> 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 (); }
20
MvvmCross Cross Platform MVVM Development Framework Free, open source Supports WP7,8 WPF WinRT Xamarin.Android Xamarin.iOS Xamarin.Mac AKA Mvx
21
MvvmCross Architecture
22
Using MvvmCross Hard -download from github, compile, include references etc Easy-Nuget; look for MvvmCross Hot Tuna Starter Pack, and plugins Real Easy-NinjaCoder
23
Getting started - Nuget
24
Getting started - NinjaCoder
25
Plugins Convenient way to access platform functionality Use NinjaCoder or Nuget to add plugins Includes Accelerometer, Email, Files, Location, Messaging, Sqlite 3 rd party plugins available as well. Consume plugins using Dependency Injection or Service locator
26
Plugins Demo
27
Platform specific code Describe functionality using an interface in.Core Create platform specific implementation in.xxxx Register implementation on app startup ◦Mvx.RegisterSingleton (new SettingsPersistanceWPF()); ◦Mvx.RegisterType (); Consume plugins using Dependancy Injection or Service locator persistance = Mvx.Resolve ();
28
Platform specific example Here is one that I prepared earlier
29
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
30
Links - MvvmCross Stuart Lodge - MvvmCross Author Twitter@slodge@slodge Blog http://slodge.blogspot.co.uk/http://slodge.blogspot.co.uk/ Videos http://www.youtube.com/user/MrHollywoof?feature=watchhttp://www.youtube.com/user/MrHollywoof?feature=watch List of tutorial videos http://mvvmcross.wordpress.com/http://mvvmcross.wordpress.com/ Repository https://github.com/slodge/MvvmCrosshttps://github.com/slodge/MvvmCross
31
Links - Xamarin Website - http://www.xamarin.com/http://www.xamarin.com/ Samples - https://github.com/xamarinhttps://github.com/xamarin Mobile library - https://github.com/xamarin/Xamarin.Mobilehttps://github.com/xamarin/Xamarin.Mobile
32
Links – Ninja Coder Adrian Sudbury – Ninja Coder Author Twitter@asudbury@asudbury Blog http://adriansudbury.blogspot.co.uk/http://adriansudbury.blogspot.co.uk/ Ninja Coder http://visualstudiogallery.msdn.microsoft.com/618b51f0-6de8-4f85-95ce-a50c658c7767 http://visualstudiogallery.msdn.microsoft.com/618b51f0-6de8-4f85-95ce-a50c658c7767
33
Links - Other http://www.hanselman.com/blog/CrossPlatformPortableClassLibrariesWithNETAreHappening.aspx http://sourceitsoftware.blogspot.co.nz/
34
Credits Mvvm Images from http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/MVVMhttp://books.zkoss.org/wiki/ZK_Developer%27s_Reference/MVVM
35
Questions Answers not guaranteed
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.