SlideShare une entreprise Scribd logo
1  sur  20
MvvmCross – Going Portable




        Going Portable
          @slodge
MvvmCross

 Version 1
MvvmCross       MvvmCross            MvvmCross            MvvmCross
   .WP7            .Touch               .Droid              .WinRT



MyApplication   MyApplication        MyApplication        MyApplication
   .WP7            .Touch               .Droid              .WinRT



    MyUI            MyUI                 MyUI                 MyUI
    .WP7           .Touch               .Droid               .WinRT
                       MvvmBinding          MvvmBinding
                         .Touch                .Droid
MvvmCross       MvvmCross         MvvmCross            MvvmCross
      .WP7            .Touch            .Droid              .WinRT



Core MvvmCross MyApplication
MyApplication  Library contains:     MyApplication     MyApplication
      .WP7            .Touch            .Droid           .WinRT

•   Mvvm interfaces and base classes
•   Simple DI container and IoC controller
      MyUI              MyUI               MyUI              MyUI
•   Platform specific navigation• and presentation logic
       .WP7            .Touch           M .Droid            .WinRT
•   Platform specific implementations of MvvmBinding
                            MvvmBinding
                              .Touch             .Droid
    file, location, camera, etc
MvvmCross            MvvmCross • M          MvvmCross            MvvmCross
   .WP7                 .Touch                 .Droid              .WinRT



MyApplication        MyApplication          MyApplication        MyApplication
   .WP7                 .Touch                 .Droid              .WinRT


 MyApplication Library contains:
  MyUI             MyUI                         MyUI                 MyUI
     .WP7                .Touch                .Droid               .WinRT
 •   Application startup logic
                          MvvmBinding
                            .Touch
                                                   MvvmBinding
                                                      .Droid
 •   Models and Services            •   M

 •   ViewModels
 •   ValueConverters

 Identical code across platforms – just cut-and-paste projects
MyUI Executable contains:
MvvmCross       MvvmCross             MvvmCross            MvvmCross
   .WP7             .Touch              .Droid              .WinRT
                               • M
• Platform Specific Views and Controls
• Some adaption for ValueConverters
MyApplication   MyApplication    MyApplication            MyApplication
   .WP7             .Touch              .Droid              .WinRT



   MyUI              MyUI                MyUI                 MyUI
   .WP7             .Touch              .Droid               .WinRT
                        MvvmBinding         MvvmBinding
                          .Touch               .Droid
Problems
• MvvmCross is a “fat” library – contains more than just
  mvvm!
• Compiled image sizes can be large – especially on
  MonoTouch
• Application libraries are cut and paste – a boring, error
  prone manual job
• Automated cross-platform refactoring is impossible
• No common way to extend the platform
• Each new platform added requires manual cut-and-
  paste duplication of projects
MvvmCross

Version Next
MvvmCross
                             .Portable



                           MyApplication
                             .Portable
                                              Plugin1            Plugin2
                                                                                     …
                                             .Portable          .Portable




MyUI               MyUI                     MyUI                             MyUI
.WP7              .Touch                   .Droid                           .WinRT
    MvvmCross            MvvmCross               MvvmCross                        MvvmCross
   .Adapter.Wp7        .Adapter.Touch          .Adapter.Droid                   .Adapter.WinRT


       Plugin1             Plugin1                  Plugin1                          Plugin1
        .Wp7               .Touch                   .Droid                           .WinRT


       Plugin2             Plugin2                  Plugin2                          Plugin2
        .Wp7               .Touch                   .Droid                           .WinRT


         …                   …                        …                                  …
MvvmCross
                                .Portable



                           MyApplication
MvvmCross is a single   Portable library containing:
                             .Portable
                                                 Plugin1            Plugin2
                                                                                        …
                                                .Portable          .Portable
• Mvvm base classes
• Simple DI container and IoC controller
• Plugin Loader base interfaces
   MyUI            MyUI              MyUI                                       MyUI
   .WP7              .Touch                   .Droid                           .WinRT
       MvvmCross            MvvmCross
                                        • M         MvvmCross                        MvvmCross
      .Adapter.Wp7        .Adapter.Touch          .Adapter.Droid                   .Adapter.WinRT


          Plugin1             Plugin1                  Plugin1                          Plugin1
           .Wp7               .Touch                   .Droid                           .WinRT


          Plugin2             Plugin2                  Plugin2                          Plugin2
           .Wp7               .Touch                   .Droid                           .WinRT


            …                   …                        …                                  …
MvvmCross
                                .Portable



                             MyApplication
                               .Portable
                                                Plugin1            Plugin2
                                                                                 …
                                               .Portable          .Portable




 MyUI               MyUI               MyUI             MyUI
MyApplication is a single Portable library containing: .WinRT
 .WP7              .Touch             .Droid
        MvvmCross           MvvmCross              MvvmCross                    MvvmCross

•   Application startup logic
       .Adapter.Wp7       .Adapter.Touch         .Adapter.Droid               .Adapter.WinRT


•   Models and Services Plugin1 •
         Plugin1
          .Wp7             .Touch
                                           M         Plugin1
                                                     .Droid
                                                                                 Plugin1
                                                                                 .WinRT
•   ViewModels
•
         Plugin2           Plugin2                   Plugin2                     Plugin2
    ValueConverters
          .Wp7             .Touch                    .Droid                      .WinRT


            …                   …                      …                             …
MvvmCross
                               .Portable



                            MyApplication
                              .Portable
                                               Plugin1            Plugin2
                                                                                      …
                                              .Portable          .Portable




  MyUI              MyUI                     MyUI                             MyUI
The Portable part of each Plugin:
  .WP7             .Touch                   .Droid                           .WinRT
       MvvmCross           MvvmCross              MvvmCross                        MvvmCross

• Provides the interface for that plugin
      .Adapter.Wp7       .Adapter.Touch         .Adapter.Droid                   .Adapter.WinRT


   • e.g. for Location it provides Start, Stop, and an
       Plugin1
        .Wp7
                          Plugin1 • M
                          .Touch
                                            Plugin1
                                            .Droid
                                                             Plugin1
                                                             .WinRT
     OnLocationChanged event.
• Provides an EnsureLoaded() call for initialisation at runtime
       Plugin2            Plugin2           Plugin2          Plugin2
        .Wp7              .Touch            .Droid           .WinRT


           …                   …                      …                                   …
MvvmCross
                                 .Portable

MyUI executable provides:
                               MyApplication
                                 .Portable
• Platform Specific Views and Controls
• Some adaption for ValueConverters               Plugin1
                                                 .Portable
                                                                     Plugin2
                                                                    .Portable
                                                                                         …

                                         • M

   MyUI                MyUI                     MyUI                             MyUI
   .WP7               .Touch                   .Droid                           .WinRT
        MvvmCross            MvvmCross               MvvmCross                        MvvmCross
       .Adapter.Wp7        .Adapter.Touch          .Adapter.Droid                   .Adapter.WinRT


          Plugin1              Plugin1                  Plugin1                          Plugin1
           .Wp7                .Touch                   .Droid                           .WinRT


          Plugin2              Plugin2                  Plugin2                          Plugin2
           .Wp7                .Touch                   .Droid                           .WinRT


            …                    …                        …                                  …
MvvmCross
                                 .Portable


The MvvmCross.Adapter for each platform provides:
                               MyApplication
                                 .Portable
• Platform Specific Mvvm Helpers – e.g. binding Plugin2
                                       Plugin1
• Platform Specific View and navigation
                                                                             …
                                      .Portable .Portable

                             • M
• Platform Specific Plugin Manager/Loader
   MyUI                MyUI                     MyUI                 MyUI
   .WP7               .Touch                   .Droid               .WinRT
        MvvmCross            MvvmCross               MvvmCross            MvvmCross
       .Adapter.Wp7        .Adapter.Touch          .Adapter.Droid       .Adapter.WinRT


          Plugin1              Plugin1                  Plugin1              Plugin1
           .Wp7                .Touch                   .Droid               .WinRT


          Plugin2              Plugin2                  Plugin2              Plugin2
           .Wp7                .Touch                   .Droid               .WinRT


            …                    …                        …                      …
Plugin Implementations:              MvvmCross
                                      .Portable

• Provide platform specific implementations of each Plugin
  Interface                  MyApplication
   • e.g. for Location a platform specific service will provide
                                 .Portable
      Start, Stop, and OnLocationChanged.      Plugin1
                                              .Portable
                                                                 Plugin2
                                                                .Portable
                                                                                  …

• Are initialised at runtime using a mixture of:
                                      • M
   • Project references
                      MyUI
   • Convention-based dynamic assembly loading MyUI
  MyUI                                      MyUI
  .WP7               .Touch                .Droid                         .WinRT
   • Setup Helpers on platforms that don’t support
       MvvmCross            MvvmCross              MvvmCross                    MvvmCross
      Assembly.Load()
      .Adapter.Wp7        .Adapter.Touch         .Adapter.Droid               .Adapter.WinRT


           Plugin1                  Plugin1                Plugin1                  Plugin1
            .Wp7                    .Touch                 .Droid                   .WinRT


           Plugin2                  Plugin2                Plugin2                  Plugin2
            .Wp7                    .Touch                 .Droid                   .WinRT


             …                        …                      …                        …
Plugins – Portable Interfaces
In the Portable Library – Plugins.Email.dll:

   public interface IMvxComposeEmailTask
   {
       void ComposeEmail(string to, string cc, string subject, string body, bool isHtml);
   }


   public class PluginLoader
        : IMvxPluginLoader
        , IMvxServiceConsumer<IMvxPluginManager>
    {
        public static readonly PluginLoader Instance = new PluginLoader();

        #region Implementation of IMvxPluginLoader

        public void EnsureLoaded()
        {
            var manager = this.GetService<IMvxPluginManager>();
            manager.EnsureLoaded<PluginLoader>();

        }

        #endregion
    }
Plugins – Portable Use

The plugin can be used in a Portable ViewModel as simply as:



      protected void ComposeEmail(string to, string subject, string body)
      {
           Cirrious.MvvmCross.Plugins.Email.PluginLoader.Instance.EnsureLoaded();
           var task = this.GetService<IMvxComposeEmailTask>();
           task.ComposeEmail(to, null, subject, body, false);
      }
Plugins – Platform Specific
                Implementations
In one platform specific implementation – Plugins.Email.WindowsPhone.dll:
  public class MvxComposeEmailTask : MvxWindowsPhoneTask, IMvxComposeEmailTask
  {
       public void ComposeEmail(string to, string cc, string subject, string body, bool isHtml)
       {
           var task = new EmailComposeTask() { To = to, Subject = subject, Cc = cc, Body = body };
           DoWithInvalidOperationProtection(task.Show);
       }
    }


   public class Plugin
        : IMvxPlugin
        , IMvxServiceProducer<IMvxComposeEmailTask>
    {
        #region Implementation of IMvxPlugin

        public void Load()
        {
            this.RegisterServiceType<IMvxComposeEmailTask, MvxComposeEmailTask>();
        }

        #endregion
    }
Advantages
• Core MvvmCross is now a much smaller library
• Compiled image sizes can be much smaller – especially
  on MonoTouch
• Each Application is now a single library
• Cross-platform refactoring now a reality
• Manual cut-and-paste between projects eliminated
• Plugin technique allows easy extensibility for everyone
• New portable architecture makes it easier to add ans
  support new platforms –
  Silverlight, WPF, MonoMac, PlayStationSuite, …
Progress…




Working now:          In progress:
• WP7                 • MonoTouch
• Mono for Android
• WinRT

Contenu connexe

En vedette

C# Powered Robots, C# Powered Mobile Apps
C# Powered Robots, C# Powered Mobile AppsC# Powered Robots, C# Powered Mobile Apps
C# Powered Robots, C# Powered Mobile AppsJames Montemagno
 
.Net Standard Libraries and Xamarin
.Net Standard Libraries and Xamarin.Net Standard Libraries and Xamarin
.Net Standard Libraries and XamarinJames Montemagno
 
Xamarin Dev Days - Introduction to Xamarin.Forms, Insights, Test Cloud
Xamarin Dev Days -  Introduction to Xamarin.Forms, Insights, Test CloudXamarin Dev Days -  Introduction to Xamarin.Forms, Insights, Test Cloud
Xamarin Dev Days - Introduction to Xamarin.Forms, Insights, Test CloudJames Montemagno
 
Xamarin 4 - the future of apps
Xamarin 4  - the future of appsXamarin 4  - the future of apps
Xamarin 4 - the future of appsJames Montemagno
 
Build 2016 - B836 - Cross-Platform Mobile with Xamarin
Build 2016 - B836 - Cross-Platform Mobile with XamarinBuild 2016 - B836 - Cross-Platform Mobile with Xamarin
Build 2016 - B836 - Cross-Platform Mobile with XamarinWindows Developer
 
Mobile Enterprise Success with Xamarin and IBM
Mobile Enterprise Success with Xamarin and IBMMobile Enterprise Success with Xamarin and IBM
Mobile Enterprise Success with Xamarin and IBMXamarin
 
Introduction to Xamarin 2.0
Introduction to Xamarin 2.0Introduction to Xamarin 2.0
Introduction to Xamarin 2.0Xamarin
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersBoom Shukla
 
Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4Xamarin
 
Cross platform development with c# and xamarin
Cross platform development with c# and xamarinCross platform development with c# and xamarin
Cross platform development with c# and xamarinLuca Zulian
 

En vedette (10)

C# Powered Robots, C# Powered Mobile Apps
C# Powered Robots, C# Powered Mobile AppsC# Powered Robots, C# Powered Mobile Apps
C# Powered Robots, C# Powered Mobile Apps
 
.Net Standard Libraries and Xamarin
.Net Standard Libraries and Xamarin.Net Standard Libraries and Xamarin
.Net Standard Libraries and Xamarin
 
Xamarin Dev Days - Introduction to Xamarin.Forms, Insights, Test Cloud
Xamarin Dev Days -  Introduction to Xamarin.Forms, Insights, Test CloudXamarin Dev Days -  Introduction to Xamarin.Forms, Insights, Test Cloud
Xamarin Dev Days - Introduction to Xamarin.Forms, Insights, Test Cloud
 
Xamarin 4 - the future of apps
Xamarin 4  - the future of appsXamarin 4  - the future of apps
Xamarin 4 - the future of apps
 
Build 2016 - B836 - Cross-Platform Mobile with Xamarin
Build 2016 - B836 - Cross-Platform Mobile with XamarinBuild 2016 - B836 - Cross-Platform Mobile with Xamarin
Build 2016 - B836 - Cross-Platform Mobile with Xamarin
 
Mobile Enterprise Success with Xamarin and IBM
Mobile Enterprise Success with Xamarin and IBMMobile Enterprise Success with Xamarin and IBM
Mobile Enterprise Success with Xamarin and IBM
 
Introduction to Xamarin 2.0
Introduction to Xamarin 2.0Introduction to Xamarin 2.0
Introduction to Xamarin 2.0
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
 
Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4
 
Cross platform development with c# and xamarin
Cross platform development with c# and xamarinCross platform development with c# and xamarin
Cross platform development with c# and xamarin
 

Similaire à Mvvm cross – going portable

Design and develop cross-platform mobile apps using MVVMCross
Design and develop cross-platform mobile apps using MVVMCrossDesign and develop cross-platform mobile apps using MVVMCross
Design and develop cross-platform mobile apps using MVVMCrossDan Ardelean
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Maksim Shudrak
 
Innomatic Platform Architecture Overview
Innomatic Platform Architecture OverviewInnomatic Platform Architecture Overview
Innomatic Platform Architecture OverviewInnomatic Platform
 
Using java interop in your xamarin.android apps
Using java interop in your xamarin.android appsUsing java interop in your xamarin.android apps
Using java interop in your xamarin.android appsWillem Meints
 
Node.js post-mortem debugging with mdb and SmartOS
Node.js post-mortem debugging with mdb and SmartOSNode.js post-mortem debugging with mdb and SmartOS
Node.js post-mortem debugging with mdb and SmartOSjuliengilli
 
App days 2016 munich - Leaware - real time cross platform app with signalr ...
App days 2016   munich - Leaware - real time cross platform app with signalr ...App days 2016   munich - Leaware - real time cross platform app with signalr ...
App days 2016 munich - Leaware - real time cross platform app with signalr ...Leaware.com
 
Nokia Qt SDK in action - Qt developer days 2010
Nokia Qt SDK in action - Qt developer days 2010Nokia Qt SDK in action - Qt developer days 2010
Nokia Qt SDK in action - Qt developer days 2010Nokia
 
Win rt fundamentals
Win rt fundamentalsWin rt fundamentals
Win rt fundamentalsKevin Stumpf
 
Mobile Application Development JEDI
Mobile Application Development JEDIMobile Application Development JEDI
Mobile Application Development JEDIAlver Noquiao
 
Microsoft Automotive Business Unit - J Za
Microsoft Automotive Business Unit - J ZaMicrosoft Automotive Business Unit - J Za
Microsoft Automotive Business Unit - J Zamfrancis
 
Helping the Lions Roar
Helping the Lions RoarHelping the Lions Roar
Helping the Lions RoarStuart Lodge
 
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 6Nicolas Milcoff
 
Supercharge your releases with netflix nebula
Supercharge your releases with netflix nebulaSupercharge your releases with netflix nebula
Supercharge your releases with netflix nebulaDanijel Mitar
 
BruCon (Brussels 2011) Hacking Conference - Botnets and Browsers (Brothers in...
BruCon (Brussels 2011) Hacking Conference - Botnets and Browsers (Brothers in...BruCon (Brussels 2011) Hacking Conference - Botnets and Browsers (Brothers in...
BruCon (Brussels 2011) Hacking Conference - Botnets and Browsers (Brothers in...Aditya K Sood
 
Triton + Docker, July 2015
Triton + Docker, July 2015Triton + Docker, July 2015
Triton + Docker, July 2015Casey Bisson
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android SecurityMarakana Inc.
 
Discover the Linux on z Systems Effect
Discover the Linux on z Systems EffectDiscover the Linux on z Systems Effect
Discover the Linux on z Systems EffectIBM
 
Prairie DevCon-What's New in Hyper-V in Windows Server "8" Beta - Part 2
Prairie DevCon-What's New in Hyper-V in Windows Server "8" Beta - Part 2Prairie DevCon-What's New in Hyper-V in Windows Server "8" Beta - Part 2
Prairie DevCon-What's New in Hyper-V in Windows Server "8" Beta - Part 2Damir Bersinic
 

Similaire à Mvvm cross – going portable (20)

Design and develop cross-platform mobile apps using MVVMCross
Design and develop cross-platform mobile apps using MVVMCrossDesign and develop cross-platform mobile apps using MVVMCross
Design and develop cross-platform mobile apps using MVVMCross
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
 
Innomatic Platform Architecture Overview
Innomatic Platform Architecture OverviewInnomatic Platform Architecture Overview
Innomatic Platform Architecture Overview
 
Using java interop in your xamarin.android apps
Using java interop in your xamarin.android appsUsing java interop in your xamarin.android apps
Using java interop in your xamarin.android apps
 
Node.js post-mortem debugging with mdb and SmartOS
Node.js post-mortem debugging with mdb and SmartOSNode.js post-mortem debugging with mdb and SmartOS
Node.js post-mortem debugging with mdb and SmartOS
 
App days 2016 munich - Leaware - real time cross platform app with signalr ...
App days 2016   munich - Leaware - real time cross platform app with signalr ...App days 2016   munich - Leaware - real time cross platform app with signalr ...
App days 2016 munich - Leaware - real time cross platform app with signalr ...
 
VIPER ( ? OR : AND) MVVM
VIPER ( ? OR : AND) MVVMVIPER ( ? OR : AND) MVVM
VIPER ( ? OR : AND) MVVM
 
Making of GameOver
Making of GameOverMaking of GameOver
Making of GameOver
 
Nokia Qt SDK in action - Qt developer days 2010
Nokia Qt SDK in action - Qt developer days 2010Nokia Qt SDK in action - Qt developer days 2010
Nokia Qt SDK in action - Qt developer days 2010
 
Win rt fundamentals
Win rt fundamentalsWin rt fundamentals
Win rt fundamentals
 
Mobile Application Development JEDI
Mobile Application Development JEDIMobile Application Development JEDI
Mobile Application Development JEDI
 
Microsoft Automotive Business Unit - J Za
Microsoft Automotive Business Unit - J ZaMicrosoft Automotive Business Unit - J Za
Microsoft Automotive Business Unit - J Za
 
Helping the Lions Roar
Helping the Lions RoarHelping the Lions Roar
Helping the Lions Roar
 
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
 
Supercharge your releases with netflix nebula
Supercharge your releases with netflix nebulaSupercharge your releases with netflix nebula
Supercharge your releases with netflix nebula
 
BruCon (Brussels 2011) Hacking Conference - Botnets and Browsers (Brothers in...
BruCon (Brussels 2011) Hacking Conference - Botnets and Browsers (Brothers in...BruCon (Brussels 2011) Hacking Conference - Botnets and Browsers (Brothers in...
BruCon (Brussels 2011) Hacking Conference - Botnets and Browsers (Brothers in...
 
Triton + Docker, July 2015
Triton + Docker, July 2015Triton + Docker, July 2015
Triton + Docker, July 2015
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Discover the Linux on z Systems Effect
Discover the Linux on z Systems EffectDiscover the Linux on z Systems Effect
Discover the Linux on z Systems Effect
 
Prairie DevCon-What's New in Hyper-V in Windows Server "8" Beta - Part 2
Prairie DevCon-What's New in Hyper-V in Windows Server "8" Beta - Part 2Prairie DevCon-What's New in Hyper-V in Windows Server "8" Beta - Part 2
Prairie DevCon-What's New in Hyper-V in Windows Server "8" Beta - Part 2
 

Plus de Stuart Lodge

Hot tuna - from Sean Cross
Hot tuna - from Sean CrossHot tuna - from Sean Cross
Hot tuna - from Sean CrossStuart Lodge
 
MvvmCross Introduction
MvvmCross IntroductionMvvmCross Introduction
MvvmCross IntroductionStuart Lodge
 
Wpug meeting - wp to win8 experiences
Wpug meeting - wp to win8 experiencesWpug meeting - wp to win8 experiences
Wpug meeting - wp to win8 experiencesStuart Lodge
 
AlphaLabs - Node Garden with Speech
AlphaLabs - Node Garden with Speech AlphaLabs - Node Garden with Speech
AlphaLabs - Node Garden with Speech Stuart Lodge
 
About Cirrious ltd
About Cirrious ltdAbout Cirrious ltd
About Cirrious ltdStuart Lodge
 
C# Client to Cloud
C# Client to CloudC# Client to Cloud
C# Client to CloudStuart Lodge
 
How to make a pig udf
How to make a pig udfHow to make a pig udf
How to make a pig udfStuart Lodge
 
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)Stuart Lodge
 
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 databindingStuart Lodge
 
Wpug mvvm and data binding
Wpug   mvvm and data bindingWpug   mvvm and data binding
Wpug mvvm and data bindingStuart Lodge
 
Ui testing for Windows Phone
Ui testing for Windows PhoneUi testing for Windows Phone
Ui testing for Windows PhoneStuart Lodge
 
Ui Testing on Windows Phone
Ui Testing on Windows PhoneUi Testing on Windows Phone
Ui Testing on Windows PhoneStuart Lodge
 
How To use Map Blogs
How To use Map BlogsHow To use Map Blogs
How To use Map BlogsStuart Lodge
 
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 NukeStuart 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 NukeStuart Lodge
 
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 5Stuart Lodge
 
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 cloudsStuart Lodge
 

Plus de Stuart Lodge (17)

Hot tuna - from Sean Cross
Hot tuna - from Sean CrossHot tuna - from Sean Cross
Hot tuna - from Sean Cross
 
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)
 
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
 

Dernier

Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Neil Kimberley
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...amitlee9823
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Lviv Startup Club
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...rajveerescorts2022
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxB.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxpriyanshujha201
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityEric T. Tung
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...amitlee9823
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756dollysharma2066
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Roland Driesen
 

Dernier (20)

Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxB.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...
 

Mvvm cross – going portable

  • 1. MvvmCross – Going Portable Going Portable @slodge
  • 3. MvvmCross MvvmCross MvvmCross MvvmCross .WP7 .Touch .Droid .WinRT MyApplication MyApplication MyApplication MyApplication .WP7 .Touch .Droid .WinRT MyUI MyUI MyUI MyUI .WP7 .Touch .Droid .WinRT MvvmBinding MvvmBinding .Touch .Droid
  • 4. MvvmCross MvvmCross MvvmCross MvvmCross .WP7 .Touch .Droid .WinRT Core MvvmCross MyApplication MyApplication Library contains: MyApplication MyApplication .WP7 .Touch .Droid .WinRT • Mvvm interfaces and base classes • Simple DI container and IoC controller MyUI MyUI MyUI MyUI • Platform specific navigation• and presentation logic .WP7 .Touch M .Droid .WinRT • Platform specific implementations of MvvmBinding MvvmBinding .Touch .Droid file, location, camera, etc
  • 5. MvvmCross MvvmCross • M MvvmCross MvvmCross .WP7 .Touch .Droid .WinRT MyApplication MyApplication MyApplication MyApplication .WP7 .Touch .Droid .WinRT MyApplication Library contains: MyUI MyUI MyUI MyUI .WP7 .Touch .Droid .WinRT • Application startup logic MvvmBinding .Touch MvvmBinding .Droid • Models and Services • M • ViewModels • ValueConverters Identical code across platforms – just cut-and-paste projects
  • 6. MyUI Executable contains: MvvmCross MvvmCross MvvmCross MvvmCross .WP7 .Touch .Droid .WinRT • M • Platform Specific Views and Controls • Some adaption for ValueConverters MyApplication MyApplication MyApplication MyApplication .WP7 .Touch .Droid .WinRT MyUI MyUI MyUI MyUI .WP7 .Touch .Droid .WinRT MvvmBinding MvvmBinding .Touch .Droid
  • 7. Problems • MvvmCross is a “fat” library – contains more than just mvvm! • Compiled image sizes can be large – especially on MonoTouch • Application libraries are cut and paste – a boring, error prone manual job • Automated cross-platform refactoring is impossible • No common way to extend the platform • Each new platform added requires manual cut-and- paste duplication of projects
  • 9. MvvmCross .Portable MyApplication .Portable Plugin1 Plugin2 … .Portable .Portable MyUI MyUI MyUI MyUI .WP7 .Touch .Droid .WinRT MvvmCross MvvmCross MvvmCross MvvmCross .Adapter.Wp7 .Adapter.Touch .Adapter.Droid .Adapter.WinRT Plugin1 Plugin1 Plugin1 Plugin1 .Wp7 .Touch .Droid .WinRT Plugin2 Plugin2 Plugin2 Plugin2 .Wp7 .Touch .Droid .WinRT … … … …
  • 10. MvvmCross .Portable MyApplication MvvmCross is a single Portable library containing: .Portable Plugin1 Plugin2 … .Portable .Portable • Mvvm base classes • Simple DI container and IoC controller • Plugin Loader base interfaces MyUI MyUI MyUI MyUI .WP7 .Touch .Droid .WinRT MvvmCross MvvmCross • M MvvmCross MvvmCross .Adapter.Wp7 .Adapter.Touch .Adapter.Droid .Adapter.WinRT Plugin1 Plugin1 Plugin1 Plugin1 .Wp7 .Touch .Droid .WinRT Plugin2 Plugin2 Plugin2 Plugin2 .Wp7 .Touch .Droid .WinRT … … … …
  • 11. MvvmCross .Portable MyApplication .Portable Plugin1 Plugin2 … .Portable .Portable MyUI MyUI MyUI MyUI MyApplication is a single Portable library containing: .WinRT .WP7 .Touch .Droid MvvmCross MvvmCross MvvmCross MvvmCross • Application startup logic .Adapter.Wp7 .Adapter.Touch .Adapter.Droid .Adapter.WinRT • Models and Services Plugin1 • Plugin1 .Wp7 .Touch M Plugin1 .Droid Plugin1 .WinRT • ViewModels • Plugin2 Plugin2 Plugin2 Plugin2 ValueConverters .Wp7 .Touch .Droid .WinRT … … … …
  • 12. MvvmCross .Portable MyApplication .Portable Plugin1 Plugin2 … .Portable .Portable MyUI MyUI MyUI MyUI The Portable part of each Plugin: .WP7 .Touch .Droid .WinRT MvvmCross MvvmCross MvvmCross MvvmCross • Provides the interface for that plugin .Adapter.Wp7 .Adapter.Touch .Adapter.Droid .Adapter.WinRT • e.g. for Location it provides Start, Stop, and an Plugin1 .Wp7 Plugin1 • M .Touch Plugin1 .Droid Plugin1 .WinRT OnLocationChanged event. • Provides an EnsureLoaded() call for initialisation at runtime Plugin2 Plugin2 Plugin2 Plugin2 .Wp7 .Touch .Droid .WinRT … … … …
  • 13. MvvmCross .Portable MyUI executable provides: MyApplication .Portable • Platform Specific Views and Controls • Some adaption for ValueConverters Plugin1 .Portable Plugin2 .Portable … • M MyUI MyUI MyUI MyUI .WP7 .Touch .Droid .WinRT MvvmCross MvvmCross MvvmCross MvvmCross .Adapter.Wp7 .Adapter.Touch .Adapter.Droid .Adapter.WinRT Plugin1 Plugin1 Plugin1 Plugin1 .Wp7 .Touch .Droid .WinRT Plugin2 Plugin2 Plugin2 Plugin2 .Wp7 .Touch .Droid .WinRT … … … …
  • 14. MvvmCross .Portable The MvvmCross.Adapter for each platform provides: MyApplication .Portable • Platform Specific Mvvm Helpers – e.g. binding Plugin2 Plugin1 • Platform Specific View and navigation … .Portable .Portable • M • Platform Specific Plugin Manager/Loader MyUI MyUI MyUI MyUI .WP7 .Touch .Droid .WinRT MvvmCross MvvmCross MvvmCross MvvmCross .Adapter.Wp7 .Adapter.Touch .Adapter.Droid .Adapter.WinRT Plugin1 Plugin1 Plugin1 Plugin1 .Wp7 .Touch .Droid .WinRT Plugin2 Plugin2 Plugin2 Plugin2 .Wp7 .Touch .Droid .WinRT … … … …
  • 15. Plugin Implementations: MvvmCross .Portable • Provide platform specific implementations of each Plugin Interface MyApplication • e.g. for Location a platform specific service will provide .Portable Start, Stop, and OnLocationChanged. Plugin1 .Portable Plugin2 .Portable … • Are initialised at runtime using a mixture of: • M • Project references MyUI • Convention-based dynamic assembly loading MyUI MyUI MyUI .WP7 .Touch .Droid .WinRT • Setup Helpers on platforms that don’t support MvvmCross MvvmCross MvvmCross MvvmCross Assembly.Load() .Adapter.Wp7 .Adapter.Touch .Adapter.Droid .Adapter.WinRT Plugin1 Plugin1 Plugin1 Plugin1 .Wp7 .Touch .Droid .WinRT Plugin2 Plugin2 Plugin2 Plugin2 .Wp7 .Touch .Droid .WinRT … … … …
  • 16. Plugins – Portable Interfaces In the Portable Library – Plugins.Email.dll: public interface IMvxComposeEmailTask { void ComposeEmail(string to, string cc, string subject, string body, bool isHtml); } public class PluginLoader : IMvxPluginLoader , IMvxServiceConsumer<IMvxPluginManager> { public static readonly PluginLoader Instance = new PluginLoader(); #region Implementation of IMvxPluginLoader public void EnsureLoaded() { var manager = this.GetService<IMvxPluginManager>(); manager.EnsureLoaded<PluginLoader>(); } #endregion }
  • 17. Plugins – Portable Use The plugin can be used in a Portable ViewModel as simply as: protected void ComposeEmail(string to, string subject, string body) { Cirrious.MvvmCross.Plugins.Email.PluginLoader.Instance.EnsureLoaded(); var task = this.GetService<IMvxComposeEmailTask>(); task.ComposeEmail(to, null, subject, body, false); }
  • 18. Plugins – Platform Specific Implementations In one platform specific implementation – Plugins.Email.WindowsPhone.dll: public class MvxComposeEmailTask : MvxWindowsPhoneTask, IMvxComposeEmailTask { public void ComposeEmail(string to, string cc, string subject, string body, bool isHtml) { var task = new EmailComposeTask() { To = to, Subject = subject, Cc = cc, Body = body }; DoWithInvalidOperationProtection(task.Show); } } public class Plugin : IMvxPlugin , IMvxServiceProducer<IMvxComposeEmailTask> { #region Implementation of IMvxPlugin public void Load() { this.RegisterServiceType<IMvxComposeEmailTask, MvxComposeEmailTask>(); } #endregion }
  • 19. Advantages • Core MvvmCross is now a much smaller library • Compiled image sizes can be much smaller – especially on MonoTouch • Each Application is now a single library • Cross-platform refactoring now a reality • Manual cut-and-paste between projects eliminated • Plugin technique allows easy extensibility for everyone • New portable architecture makes it easier to add ans support new platforms – Silverlight, WPF, MonoMac, PlayStationSuite, …
  • 20. Progress… Working now: In progress: • WP7 • MonoTouch • Mono for Android • WinRT