SlideShare a Scribd company logo
1 of 156
Cross Platform
Mobile Application Development
met Xamarin
en T4
Jermaine Jong
Daan Jonkers
Matthijs van der Veer
Performance
                             Objective-C




                                           Prototyping
       Animations   Design
TeaLight
A framework to quickly start,
generate code and still be flexibel.
A framework to quickly start,
generate code and still be flexibel.
A framework to quickly start,
generate code and still be flexibel.
A framework to quickly start,
generate code and still be flexibel.
MvvmCross
Base


 Shared



MvvmCross



 TeaLight
Base      Designs


 Shared     Domain



MvvmCross     UX



 TeaLight    Style
Generator
  Base      Designs
                         s


 Shared     Domain     Entities



MvvmCross     UX        Views



 TeaLight    Style       T4
Generator
  Base      Designs               Compilers
                         s


 Shared     Domain     Entities    Microsoft



MvvmCross     UX        Views      Xamarin



 TeaLight    Style       T4         Stores
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
WinRT


Windows
 Phone


Silverlight



   iOS



Android
WinRT


Windows        Windows         Windows        Windows
 Phone         Phone 7         Phone 7.5      Phone 8


Silverlight   Silverlight 4   Silverlight 5



   iOS



Android
Windows       Windows     Windows
 WinRT
              Phone 7       Phone 7.5   Phone 8




Silverlight   Silverlight
                              iOS       Android
     4             5
Windows       Windows     Windows
  WinRT
              Phone 7       Phone 7.5   Phone 8




WinRT.Core




Silverlight   Silverlight
                              iOS       Android
     4             5
Windows       Windows     Windows
  WinRT
               Phone 7       Phone 7.5   Phone 8




WinRT.Core    Phone7.Core




Silverlight    Silverlight
                               iOS       Android
     4              5
Windows        Windows        Windows
  WinRT
               Phone 7        Phone 7.5      Phone 8




WinRT.Core    Phone7.Core    Phone75.Core   Phone8.Core




 SL4.Core      SL5.Core        iOS.Core     Android.Core



Silverlight    Silverlight
                                 iOS          Android
     4              5
Windows              Windows     Windows
 WinRT
              Phone 7              Phone 7.5   Phone 8




                            Core




Silverlight   Silverlight
                                     iOS       Android
     4             5
Portable Class Library
Portable Class Library
•   1 Project voor meerdere platformen
•   Bouwt een DLL per platform
•   References naar andere PCL‟s
•   Subset van .NET
Portable Class Library
• iOS en Android ondersteuning*
• Xamarin biedt binnenkort iOS en
  Android ondersteuning
• MS klein begonnen
• Verwachting: meer SDK‟s als PCL‟s
#IF
• Conditional compilation
• Wordt gebruikt in MvvmCross
• Kleine verschillen
#IF
public void PlatformSpecific()
{
    #if NETFX_CORE
       // code for Windows 8
    #else
       // code for other platforms
    #endif
}
#IF: onze ervaring
• Niet veel gebruiken
• Rommelige code
Project Linker
Project Linker
• Oorspronkelijk voor WPF/Silverlight
• Last resort
Project Linker
       Project 1

        Class1

        Class2

        Class3
Project Linker
       Project 1   Project 2

        Class1

        Class2

        Class3
Project Linker
       Project 1   Project 2

        Class1

        Class2

        Class3
Project Linker
       Project 1   Project 2

        Class1     Class1*

        Class2     Class2*

        Class3     Class3*
Project Linker
       Project 1   Project 2

        Class1     Class1*

        Class2     Class2*

        Class3     Class3*

        Class4
Project Linker
       Project 1   Project 2

        Class1     Class1*

        Class2     Class2*

        Class3     Class3*

        Class4     Class4*
Project Linker
       Project 1   Project 2

        Class1     Class1*

        Class2     Class2*
Project Linker
• Oorspronkelijk voor WPF/Silverlight
• Last resort
• Visual Studio 2010

• Visual Studio Gallery
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Mvvm
• Adaptatie van MVC
Model
• Object model
• Data access layer
View
• All UI controls
ViewModel
• Letterlijk „model of the view‟
• Data die je wil tonen
Mvvm
• 1 ViewModel per View
• View „bind‟ op ViewModel
Mvvm Binding
<TextBlock Text="M van der Veer" />
Mvvm Binding
<TextBlock Text="{Binding Name}" />
MvvmCross
• Android & iOS is vaak MVC
• Geen MVVM support

• Bindings voor iOS en Android!
Model



ViewModel



  View
Model



             ViewModel



WinRT.View    iOS.View   Android.View
Model



             ViewModel



WinRT.View    iOS.View   Android.View
Model



             ViewModel



WinRT.View    iOS.View   Android.View
MvvmCross
• Thin view layer
• Navigatie zit in ViewModel
MvvmCross
• “Fat Library”
  – IoC Container
  – Value Converters
  – Navigatie
  – Plugin structuur
Plugins
• Implementatie per platform?
• En zonder #IF
Interface
public interface IMvxWebBrowserTask
{
     void ShowWebPage(string url);
}
Implementation
public class MvxWebBrowserTask : IMvxWebBrowserTask
{




}
Implementation

   public void ShowWebPage(string url)
   {
        Launcher.LaunchUriAsync(new Uri(url));
   }
Use
this.RegisterServiceType
<IMvxWebBrowserTask, MvxWebBrowserTask>();
Use
protected void ShowWebPage(string webPage)
{
     var task = this.GetService<IMvxWebBrowserTask>();
     task.ShowWebPage(webPage);
}
Plugins
• 1 PCL
• 1 assembly per implementatie
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
TeaLight
Een framework om snel te starten
door code te genereren en toch
flexibel is.
MODEL
MODEL



        GENERATOR
MODEL



        GENERATOR


                    PRODUCTS
TeaLight Foundation
TeaLight Foundation
• Uitbreiding op MvvmCross
• Genereren
  – Views
  – ViewModels
  – Models
  – Database
Text Template
Transformation Toolkit
T4
T4 Utility Belt
T4 Utility Belt
• Classes en templates
• Plumbing code
• Controls
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Application Design

         Domain      UX
UX

                           Business
               UX
                            Sqlite
             Business
                          Synchronize
           Web Services
  UX                      Azure SQL

Business


 Sqlite
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Conference Data Design
                    SpeakerSessio
   Speakers                         Sessions
                         n




Data Design

    Entity               Entity      Entity
Entity

   Properties

   Primary
   Key
   String
   Double
   Image
   Etc. Etc.
   Etc.
   Parent       Parent Entity
Name         <Entity Name="Sessions">
                            <StringProperty Name="Name" />
Sessions     Descriptio     <StringProperty Name="Description" />
             n            </Entity>




                          <Entity Name="SessionSpeakers">
             Session        <Parent ToName="Session" Name="SessionId"/>
SpeakerSession              <Parent ToName="Speaker" Name="SpeakerId"/>
             Speaker      </Entity>




             Name         <Entity Name="Speakers">
                             <StringProperty  Name="Name" Length="255" />
Speakers     Cost            <DoubleProperty  Name="Rate" />
                             <ImageProperty   Name="Picture" />
             Picture
                          </Entity>
Validations       <StringProperty Name="Name">
                      <RequiredValidation />
   Required       </StringProperty>

   Minimum        <DoubleProperty Name="Rate" >
                      <MinimumValidation Value="100"/>
   Maximum            <MaximumValidation Value="1000"/>
                  </DoubleProperty>
   Custom
                  <StringProperty Name="Telephone" >
                     <CustomValidation Name="CheckNr" />
                  </StringProperty>

   Per Property
Validations



                  <Entity Name="Speaker">
                    <Validations>

                     <CustomValidation Name="CheckSpeaker" />
   Custom
                    </Validations>
                  </Entity>



     Per Entity
Processing



                 <Entity Name="Speaker">
                   <Processing>

      Pre           <PreUpdate Name="PreUpdateSpeaker" />
      Pos           <PostUpdate Name="PostUpdateSpeaker" />
      t
                   </Processing>
                 </Entity>
    Per Entity
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Text   Button   Tabs
Technology        Text              Button

             <TextBox           <Button
  XAML         Text="."/>        Click="."/>


                                <Button
             <EditText
  AXML       a:text="."/>
                                 l:MvxBind="
                                 Click ." />


                                button =
             New
Code /        EntryElement ()
                                   UIButton
                                     .FromType(.)
XIB
Type                   Control



 Text    <StringControl PropertyName=“Name”/>




Button          <Button Text=“Save”/>



                   <TabControl>
Tabs          <TabPage Text=“Header”/>
                   </TabControl>
Screen        <Screen>

                 <Header>
Header               <Header />
                 </Header>

Content
                 <Content>
                     <LabelControl />
                     <StringControl />
                 </Content>


                 <ActionBar>
 Action Bar           <ActionButton />
                 </ActionBar>

              </Screen>
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Styles


           Colors

         Dimensions
                      Resource Files
           Fonts


         Animations
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Collection             Services

                         Data
  Entity     Mappers
                       Contracts




             Models
 Database
              View
             Models
Domain                Templates              Code


                                          class SpeakerCollection
<Entity Name="Speaker">                     : Collection<Speaker>
  <String.. Name="Name" />   Collection   {}




                                          class Speaker
                                            : Entity
                               Entity     {
                                             string Name { get; set; }




                                          create table Speaker(
                               SQL             Name NVARCHAR(255))
Renderer   Type
Templates
               s       Render Method



             String    string Name

                       string Id
                       SpeakerEntity Speaker
                       {
                         get
                         {
             Parent         return Repository
                               .GetSpeaker(Id);
                         }
                       }
Flexibility
        partial     class Speakers
                    {
classes                string FirstName;
                       string LastName;


    Class Speaker
                        string FullName()
                        {
                            return FirstName + " " + LastName;
                        }
                    }
Flexibility       partial class Speakers
        partial   {
classes              string FirstName;
                     string LastName;
      Generated
                  }


                  partial class Speakers
                  {
                     string FullName()
       Manual        {
                         return FirstName + " " + LastName;
                     }
                  }
partial class Speakers
partial functions   {
                        void SetProperty()
                        {
                            Validate();
      Definition        }

                        partial void Validate();
                    }

                    partial class Speakers
   Implementation   {
                       partial void Validate()
                       {
                           …
                       }
                    }
Base classes
                 public class Collection<T>
Generics         {
                    void Add(T item);
                    T this[int index] { get; set; }
      Manual        IList.Remove(object value);
                 …
                 }



                 class SpeakerCollection
     Generated     : Collection<Speaker>
                 {}
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Control            Renderer               Code


                                     <TextBlock Text="Name" />



<LabelControl                      new StringElement
       Text="Name" />                         ("Name", "Name")



                                   <TextView
                                       android:text="Name" />
Bindings       Renderer            Code


                             Text="{Binding Name}"




Text="{Name}"              .Bind(this, "Text Name")




                           local:MvxBind="Text Name"
Screens   Templates   Renderers


Create
                      .xaml .cs

 Read
                         .cs
Update


 Lists                .axml .cs
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
T4
     Text
  Template
Transformation
   Toolkit
<#@ template language="C#" #>
Template   Hello
           <# string text = "World!"; #>
           <#= text #>
<#@ template language="C#" #>
Template   Hello
           <# string text = "World!"; #>
           <#= text #>


           public class Template
           {
             public string TransformText()
Compiled     {
Template        Write("Hello");
                string text = "World!";
                Write(text);
                return GeneratedCode;
             }
           }
<#@ template language="C#" #>
Template   Hello
           <# string text = "World!"; #>
           <#= text #>


           public class Template
           {
             public string TransformText()
Compiled     {
Template        Write("Hello");
                string text = "World!";
                Write(text);
                return GeneratedCode;
             }
           }



 Output      Hello
             World!
using TeaLightV5.Foundation;

       namespace MyNameSpace
text   {
       }
<#


code        string text = "World!";

       #>
value   <#=text#>
value
         =
        <#   text#>
<#
          if (type is string)
          {
     #>

if   <#
              public string _name;

          }
     #>
<#
              foreach (string name in names)
              {
         #>

FOREAC   <#
                  public string <#=name#>;

              }
H        #>
<#// A template#>
           <#@ template hostSpecific="true" #>
           <# string ClassName = "Customer";
                string PropertyName = "Name";#>
           namespace MyNameSpace
           {
Standard      public class <#=ClassName#>
              {
Editor            public string <#=PropertyName#>
                     {get; set;}
              }
           }
<#// A template#>
              <#@ template hostSpecific="true" #>
              <# string ClassName = "Customer";
                  string PropertyName = "Name";#>
              namespace MyNameSpace
              {
Tangible T4      public class <#=ClassName#>
                 {
Editor              public string <#=PropertyName#>
                       {get; set;}
                 }
              }
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Xamarin.Android


 Xamarin.iOS
+


+
Running side by side
                                    Enough
Emulators                          RAM and
              Build for multiple
                                   PC power
                  platforms
               simultaneously
Form factors




OS versions




Dimensions
PerfectoMobile
http://www.perfectomobile.com
PerfectoMobile
http://www.perfectomobile.com

     Testing in the cloud
PerfectoMobile
http://www.perfectomobile.com

     Testing in the cloud

   Testing on live devices
App stores
App stores




$99 / year       $25      $99 / year
Xamarin
                     App size
 Starter     Free
                      limited

  Indie      $299

                       VS
Business     $999
                     support
                       VS
Enterprise   $1899
                     support
Xamarin
                     App size
 Starter     Free
                      limited

  Indie      $299

                       VS
Business     $999
                     support
                       VS
Enterprise   $1899
                     support
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Conference App

Conference.UX.   Conference.UX.      Conference.UX.   Conference.UX.
  WinPhone           WinRT            DroidPhone          Touch

Conference.Core – Shared PCL
      U
                      Models       ViewModels
      X
      Business
                        Entities
      layer
      Data access
                      Repositories
      layer

                               Tealight
Phones
Building the Conference app
Speaker entity design


<Entity Name="Speaker" >

 <StringProperty   Name="Name" />
 <StringProperty   Name="Title" />
 <StringProperty   Name="Company" />
 <StringProperty   Name="Biography" />

</Entity>
Speaker view design


<Screen EntityName="Speaker" >

       <LabelControl Text="Name" />
       <StringControl Text="{Name, Mode=TwoWay}" PropertyName="Name" />


       ...

</Screen>
Generating code

                  CREATE TABLE Speaker
                  (

                             Id UNIQUEIDENTIFIER PRIMARY KEY,
                             Name NVARCHAR(255) null,
                             Title NVARCHAR(255) null,
       Database              Company NVARCHAR(255) null,
                             Biography NVARCHAR(255) null

                  )
Generating code


                     public partial class SpeakerRepository :
                     RepositoryBase<SpeakerEntity>
                     {

                     }
      Repositories
Generating code
                  public partial class SpeakerEntity
                  {

                           [XmlElement("Name")]
                           public string Name { get; set; }

                           [XmlElement("Title")]
                           public string Title { get; set; }

       Entities            [XmlElement("Company")]
                           public string Company { get; set; }

                           [XmlElement("Biography")]
                           public string Biography { get; set; }

                  }
public partial class SpeakerModel : Model<SpeakerEntity
Generating code   {
                          public string Name
                          {
                              get
                              {
                                  return this._Name;
                              }
                              set
                              {
                                  if (Name != value)
                                  {
                                      this.OnNameChanging(value);
       Models                         this._Name = value;
                                      this.OnNameChanged();
                                      this.OnPropertyChanged("Name");
                                  }
                              }
                          }
                          private string _Name;
                          partial void OnNameChanging(string value);
                          partial void OnNameChanged();
                  ...
                  }
public class SpeakerReadEntityViewModel
                           : ReadEntityViewModel<SpeakerModel, SpeakerEntity>
Generating code    {

                          public override ICommand ReadCommand
                          {
                              get
                              {
                                  return new MvxRelayCommand(() =>
                             RequestNavigate<SpeakerReadEntityViewModel>(new
                             SpeakerModelParameters() { Id = Data.Id }));
                              }
                          }
      Viewmodels          public override ICommand EditCommand
                          {
                              get
                              {
                                  return new MvxRelayCommand(() =>
                             RequestNavigate<SpeakerUpdateEntityViewModel>(
                             new SpeakerModelParameters() { Id = Data.Id ));
                              }
                          }
                      }
Generate windows views

<Grid x:Name="ContentPanel" >
 <ScrollViewer >
  <StackPanel x:Name="SpeakerPanel" DataContext="{Binding Data}">

   <TextBlock   Text="{Binding ID}"/>
   <TextBlock   Text="Name" />
   <TextBlock   Text="{Binding Name}"/>
   <TextBlock   Text="Title"/>
   <TextBlock   Text="{Binding Title}" />

   <TextBlock   Text="Company" />
   <TextBlock   Text="{Binding Company}" />
   <TextBlock   Text="Biography"/>
   <TextBlock   x:Name="Biography" Text="{Binding Biography}" TextWrapping="Wrap" />

  </StackPanel>
 </ScrollViewer>
</Grid >
Generate android views

<ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent">
  <LinearLayout android:orientation="vertical" android:layout_width="fill_parent"
      android:layout_height="wrap_content">

   <TextView android:text="Name"/>
   <TextView local:MvxBind="Text Data.Name" />

   <TextView android:text="Title"/>
   <TextView local:MvxBind="Text Data.Title"/>

   <TextView android:text="Company" />
   <TextView local:MvxBind="Path Data.Company"/>

   <TextView android:text="Biography"/>
   <TextView local:MvxBind="Text Data.Biography"/>

  </LinearLayout>
</ScrollView>
Generate iOS views
public class SpeakerView: MvxTouchDialogViewController<SpeakerReadEntityViewModel>
{
    public override void ViewDidAppear (bool animated)
    {
      base.ViewDidAppear (animated);
      ResetDisplay();
    }

    private void ResetDisplay()
    {
      this.Root = new RootElement("Speaker Info")
      {
                new Section("Contact Info")
                {
                    new StringElement("ID").Bind(this, "Value Data.Id"),
                    new StringElement("Name").Bind(this, "Value Data.Name"),
                    new StringElement("Title").Bind(this, "Value Data.Title"),
                    new StringElement("Company").Bind(this, "Value Data.Company"),
                }
        };
    }
}
Changing the Conference app
Adding a property
                                        Generate Windows
                                             views

Expand entities

                  Generate entities
                                       Generate iOs views
Expand views


   Designs        Conference.Core
                                      Generate Android views
Generator
  Base      Designs               Compilers     Apps
                         s


 Shared     Domain     Entities    Microsoft   Windows



MvvmCross     UX        Views      Xamarin     Android



 TeaLight    Style       T4         Stores      iOS
Generator
Base   Designs               Compilers   Apps
                    s




            MvvmCross

                                    80
Generator
Base      Designs                   Compilers    Apps
                          s



       <Entity   Name="Speakers">

          <StringProperty    Name="Name" />
          <DoubleProperty    Name="Rate" />
          <ImageProperty     Name="Picture" />

       </Entity>
Generator
Base   Designs               Compilers   Apps
                    s



                 Templates




T4               Renderers
                                     Flexible
Generator
Base   Designs               Compilers   Apps
                    s
Generator
Base   Designs               Compilers   Apps
                    s
Thanks
TeaLight.Wikia.com

More Related Content

Similar to Tea Light Techdays 2013 - Cross Platform Apps with .NET and Xamarin

Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talk
Imam Raza
 
Cross platform mobile development with C#
Cross platform mobile development with C#Cross platform mobile development with C#
Cross platform mobile development with C#
chriskoiak
 
Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022
NAVER D2
 

Similar to Tea Light Techdays 2013 - Cross Platform Apps with .NET and Xamarin (20)

The Great Mobile Debate: Native vs. Hybrid App Development
The Great Mobile Debate: Native vs. Hybrid App DevelopmentThe Great Mobile Debate: Native vs. Hybrid App Development
The Great Mobile Debate: Native vs. Hybrid App Development
 
Cross-Platform mobile development
Cross-Platform mobile developmentCross-Platform mobile development
Cross-Platform mobile development
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google Devs
 
PPT from Webinar Create Hybrid Mobile Application in 1 hour
PPT from Webinar Create Hybrid Mobile Application in 1 hourPPT from Webinar Create Hybrid Mobile Application in 1 hour
PPT from Webinar Create Hybrid Mobile Application in 1 hour
 
Xamarin - Beyond the Basics
Xamarin - Beyond the BasicsXamarin - Beyond the Basics
Xamarin - Beyond the Basics
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talk
 
Windows 8 & JavaScript
Windows 8 & JavaScriptWindows 8 & JavaScript
Windows 8 & JavaScript
 
Understanding Native, Hybrid, and Web Mobile Architectures
Understanding Native, Hybrid, and Web Mobile ArchitecturesUnderstanding Native, Hybrid, and Web Mobile Architectures
Understanding Native, Hybrid, and Web Mobile Architectures
 
Cross-Platform Mobile Development using Visual Studio and Xamarin
Cross-Platform Mobile Development using Visual Studio and XamarinCross-Platform Mobile Development using Visual Studio and Xamarin
Cross-Platform Mobile Development using Visual Studio and Xamarin
 
What's New, Hot, & Awesome for Xamarin Developers!
What's New, Hot, & Awesome for Xamarin Developers!What's New, Hot, & Awesome for Xamarin Developers!
What's New, Hot, & Awesome for Xamarin Developers!
 
Introduction to Xamarin
Introduction to XamarinIntroduction to Xamarin
Introduction to Xamarin
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Develop business apps cross-platform development using visual studio with x...
Develop business apps   cross-platform development using visual studio with x...Develop business apps   cross-platform development using visual studio with x...
Develop business apps cross-platform development using visual studio with x...
 
Building iOS applications with Xamarin and C#
Building iOS applications with Xamarin and C#Building iOS applications with Xamarin and C#
Building iOS applications with Xamarin and C#
 
Xamarin.Forms Bootcamp
Xamarin.Forms BootcampXamarin.Forms Bootcamp
Xamarin.Forms Bootcamp
 
Cross platform mobile development with C#
Cross platform mobile development with C#Cross platform mobile development with C#
Cross platform mobile development with C#
 
Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022
 
Build Your First iPhone or Android App with Telerik AppBuilder
Build Your First iPhone or Android App with Telerik AppBuilderBuild Your First iPhone or Android App with Telerik AppBuilder
Build Your First iPhone or Android App with Telerik AppBuilder
 
Introduction to the Tizen SDK 2.0.0 Alpha - Taiho Choi (Samsung) - Korea Lin...
Introduction to the Tizen SDK 2.0.0 Alpha - Taiho Choi  (Samsung) - Korea Lin...Introduction to the Tizen SDK 2.0.0 Alpha - Taiho Choi  (Samsung) - Korea Lin...
Introduction to the Tizen SDK 2.0.0 Alpha - Taiho Choi (Samsung) - Korea Lin...
 
Introduction to Windows 8 Development
Introduction to Windows 8 DevelopmentIntroduction to Windows 8 Development
Introduction to Windows 8 Development
 

Recently uploaded

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Recently uploaded (20)

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
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
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 

Tea Light Techdays 2013 - Cross Platform Apps with .NET and Xamarin

  • 1.
  • 2. Cross Platform Mobile Application Development met Xamarin en T4 Jermaine Jong Daan Jonkers Matthijs van der Veer
  • 3.
  • 4.
  • 5.
  • 6. Performance Objective-C Prototyping Animations Design
  • 8. A framework to quickly start, generate code and still be flexibel.
  • 9. A framework to quickly start, generate code and still be flexibel.
  • 10. A framework to quickly start, generate code and still be flexibel.
  • 11. A framework to quickly start, generate code and still be flexibel.
  • 12.
  • 15. Base Designs Shared Domain MvvmCross UX TeaLight Style
  • 16. Generator Base Designs s Shared Domain Entities MvvmCross UX Views TeaLight Style T4
  • 17. Generator Base Designs Compilers s Shared Domain Entities Microsoft MvvmCross UX Views Xamarin TeaLight Style T4 Stores
  • 18. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 19. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 20. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 22. WinRT Windows Windows Windows Windows Phone Phone 7 Phone 7.5 Phone 8 Silverlight Silverlight 4 Silverlight 5 iOS Android
  • 23. Windows Windows Windows WinRT Phone 7 Phone 7.5 Phone 8 Silverlight Silverlight iOS Android 4 5
  • 24. Windows Windows Windows WinRT Phone 7 Phone 7.5 Phone 8 WinRT.Core Silverlight Silverlight iOS Android 4 5
  • 25. Windows Windows Windows WinRT Phone 7 Phone 7.5 Phone 8 WinRT.Core Phone7.Core Silverlight Silverlight iOS Android 4 5
  • 26. Windows Windows Windows WinRT Phone 7 Phone 7.5 Phone 8 WinRT.Core Phone7.Core Phone75.Core Phone8.Core SL4.Core SL5.Core iOS.Core Android.Core Silverlight Silverlight iOS Android 4 5
  • 27. Windows Windows Windows WinRT Phone 7 Phone 7.5 Phone 8 Core Silverlight Silverlight iOS Android 4 5
  • 29. Portable Class Library • 1 Project voor meerdere platformen • Bouwt een DLL per platform • References naar andere PCL‟s • Subset van .NET
  • 30. Portable Class Library • iOS en Android ondersteuning* • Xamarin biedt binnenkort iOS en Android ondersteuning • MS klein begonnen • Verwachting: meer SDK‟s als PCL‟s
  • 31. #IF • Conditional compilation • Wordt gebruikt in MvvmCross • Kleine verschillen
  • 32. #IF public void PlatformSpecific() { #if NETFX_CORE // code for Windows 8 #else // code for other platforms #endif }
  • 33. #IF: onze ervaring • Niet veel gebruiken • Rommelige code
  • 35. Project Linker • Oorspronkelijk voor WPF/Silverlight • Last resort
  • 36. Project Linker Project 1 Class1 Class2 Class3
  • 37. Project Linker Project 1 Project 2 Class1 Class2 Class3
  • 38. Project Linker Project 1 Project 2 Class1 Class2 Class3
  • 39. Project Linker Project 1 Project 2 Class1 Class1* Class2 Class2* Class3 Class3*
  • 40. Project Linker Project 1 Project 2 Class1 Class1* Class2 Class2* Class3 Class3* Class4
  • 41. Project Linker Project 1 Project 2 Class1 Class1* Class2 Class2* Class3 Class3* Class4 Class4*
  • 42. Project Linker Project 1 Project 2 Class1 Class1* Class2 Class2*
  • 43. Project Linker • Oorspronkelijk voor WPF/Silverlight • Last resort • Visual Studio 2010 • Visual Studio Gallery
  • 44. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 46. Model • Object model • Data access layer
  • 47. View • All UI controls
  • 48. ViewModel • Letterlijk „model of the view‟ • Data die je wil tonen
  • 49. Mvvm • 1 ViewModel per View • View „bind‟ op ViewModel
  • 52. MvvmCross • Android & iOS is vaak MVC • Geen MVVM support • Bindings voor iOS en Android!
  • 54. Model ViewModel WinRT.View iOS.View Android.View
  • 55. Model ViewModel WinRT.View iOS.View Android.View
  • 56. Model ViewModel WinRT.View iOS.View Android.View
  • 57. MvvmCross • Thin view layer • Navigatie zit in ViewModel
  • 58. MvvmCross • “Fat Library” – IoC Container – Value Converters – Navigatie – Plugin structuur
  • 59. Plugins • Implementatie per platform? • En zonder #IF
  • 60. Interface public interface IMvxWebBrowserTask { void ShowWebPage(string url); }
  • 62. Implementation public void ShowWebPage(string url) { Launcher.LaunchUriAsync(new Uri(url)); }
  • 64. Use protected void ShowWebPage(string webPage) { var task = this.GetService<IMvxWebBrowserTask>(); task.ShowWebPage(webPage); }
  • 65. Plugins • 1 PCL • 1 assembly per implementatie
  • 66. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 68. Een framework om snel te starten door code te genereren en toch flexibel is.
  • 69. MODEL
  • 70. MODEL GENERATOR
  • 71. MODEL GENERATOR PRODUCTS
  • 73. TeaLight Foundation • Uitbreiding op MvvmCross • Genereren – Views – ViewModels – Models – Database
  • 75. T4
  • 76.
  • 78. T4 Utility Belt • Classes en templates • Plumbing code • Controls
  • 79. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 80. Application Design Domain UX
  • 81. UX Business UX Sqlite Business Synchronize Web Services UX Azure SQL Business Sqlite
  • 82. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 83. Conference Data Design SpeakerSessio Speakers Sessions n Data Design Entity Entity Entity
  • 84. Entity Properties Primary Key String Double Image Etc. Etc. Etc. Parent Parent Entity
  • 85. Name <Entity Name="Sessions"> <StringProperty Name="Name" /> Sessions Descriptio <StringProperty Name="Description" /> n </Entity> <Entity Name="SessionSpeakers"> Session <Parent ToName="Session" Name="SessionId"/> SpeakerSession <Parent ToName="Speaker" Name="SpeakerId"/> Speaker </Entity> Name <Entity Name="Speakers"> <StringProperty Name="Name" Length="255" /> Speakers Cost <DoubleProperty Name="Rate" /> <ImageProperty Name="Picture" /> Picture </Entity>
  • 86. Validations <StringProperty Name="Name"> <RequiredValidation /> Required </StringProperty> Minimum <DoubleProperty Name="Rate" > <MinimumValidation Value="100"/> Maximum <MaximumValidation Value="1000"/> </DoubleProperty> Custom <StringProperty Name="Telephone" > <CustomValidation Name="CheckNr" /> </StringProperty> Per Property
  • 87. Validations <Entity Name="Speaker"> <Validations> <CustomValidation Name="CheckSpeaker" /> Custom </Validations> </Entity> Per Entity
  • 88. Processing <Entity Name="Speaker"> <Processing> Pre <PreUpdate Name="PreUpdateSpeaker" /> Pos <PostUpdate Name="PostUpdateSpeaker" /> t </Processing> </Entity> Per Entity
  • 89. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 90.
  • 91. Text Button Tabs
  • 92. Technology Text Button <TextBox <Button XAML Text="."/> Click="."/> <Button <EditText AXML a:text="."/> l:MvxBind=" Click ." /> button = New Code / EntryElement () UIButton .FromType(.) XIB
  • 93. Type Control Text <StringControl PropertyName=“Name”/> Button <Button Text=“Save”/> <TabControl> Tabs <TabPage Text=“Header”/> </TabControl>
  • 94. Screen <Screen> <Header> Header <Header /> </Header> Content <Content> <LabelControl /> <StringControl /> </Content> <ActionBar> Action Bar <ActionButton /> </ActionBar> </Screen>
  • 95. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 96. Styles Colors Dimensions Resource Files Fonts Animations
  • 97. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 98. Collection Services Data Entity Mappers Contracts Models Database View Models
  • 99. Domain Templates Code class SpeakerCollection <Entity Name="Speaker"> : Collection<Speaker> <String.. Name="Name" /> Collection {} class Speaker : Entity Entity { string Name { get; set; } create table Speaker( SQL Name NVARCHAR(255))
  • 100. Renderer Type Templates s Render Method String string Name string Id SpeakerEntity Speaker { get { Parent return Repository .GetSpeaker(Id); } }
  • 101. Flexibility partial class Speakers { classes string FirstName; string LastName; Class Speaker string FullName() { return FirstName + " " + LastName; } }
  • 102. Flexibility partial class Speakers partial { classes string FirstName; string LastName; Generated } partial class Speakers { string FullName() Manual { return FirstName + " " + LastName; } }
  • 103. partial class Speakers partial functions { void SetProperty() { Validate(); Definition } partial void Validate(); } partial class Speakers Implementation { partial void Validate() { … } }
  • 104. Base classes public class Collection<T> Generics { void Add(T item); T this[int index] { get; set; } Manual IList.Remove(object value); … } class SpeakerCollection Generated : Collection<Speaker> {}
  • 105. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 106. Control Renderer Code <TextBlock Text="Name" /> <LabelControl new StringElement Text="Name" /> ("Name", "Name") <TextView android:text="Name" />
  • 107. Bindings Renderer Code Text="{Binding Name}" Text="{Name}" .Bind(this, "Text Name") local:MvxBind="Text Name"
  • 108. Screens Templates Renderers Create .xaml .cs Read .cs Update Lists .axml .cs
  • 109. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 110. T4 Text Template Transformation Toolkit
  • 111. <#@ template language="C#" #> Template Hello <# string text = "World!"; #> <#= text #>
  • 112. <#@ template language="C#" #> Template Hello <# string text = "World!"; #> <#= text #> public class Template { public string TransformText() Compiled { Template Write("Hello"); string text = "World!"; Write(text); return GeneratedCode; } }
  • 113. <#@ template language="C#" #> Template Hello <# string text = "World!"; #> <#= text #> public class Template { public string TransformText() Compiled { Template Write("Hello"); string text = "World!"; Write(text); return GeneratedCode; } } Output Hello World!
  • 114. using TeaLightV5.Foundation; namespace MyNameSpace text { }
  • 115. <# code string text = "World!"; #>
  • 116. value <#=text#>
  • 117. value = <# text#>
  • 118. <# if (type is string) { #> if <# public string _name; } #>
  • 119. <# foreach (string name in names) { #> FOREAC <# public string <#=name#>; } H #>
  • 120. <#// A template#> <#@ template hostSpecific="true" #> <# string ClassName = "Customer"; string PropertyName = "Name";#> namespace MyNameSpace { Standard public class <#=ClassName#> { Editor public string <#=PropertyName#> {get; set;} } }
  • 121. <#// A template#> <#@ template hostSpecific="true" #> <# string ClassName = "Customer"; string PropertyName = "Name";#> namespace MyNameSpace { Tangible T4 public class <#=ClassName#> { Editor public string <#=PropertyName#> {get; set;} } }
  • 122. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 124. + +
  • 125. Running side by side Enough Emulators RAM and Build for multiple PC power platforms simultaneously
  • 129. PerfectoMobile http://www.perfectomobile.com Testing in the cloud Testing on live devices
  • 131. App stores $99 / year $25 $99 / year
  • 132. Xamarin App size Starter Free limited Indie $299 VS Business $999 support VS Enterprise $1899 support
  • 133. Xamarin App size Starter Free limited Indie $299 VS Business $999 support VS Enterprise $1899 support
  • 134. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 135. Conference App Conference.UX. Conference.UX. Conference.UX. Conference.UX. WinPhone WinRT DroidPhone Touch Conference.Core – Shared PCL U Models ViewModels X Business Entities layer Data access Repositories layer Tealight
  • 136. Phones
  • 138. Speaker entity design <Entity Name="Speaker" > <StringProperty Name="Name" /> <StringProperty Name="Title" /> <StringProperty Name="Company" /> <StringProperty Name="Biography" /> </Entity>
  • 139. Speaker view design <Screen EntityName="Speaker" > <LabelControl Text="Name" /> <StringControl Text="{Name, Mode=TwoWay}" PropertyName="Name" /> ... </Screen>
  • 140. Generating code CREATE TABLE Speaker ( Id UNIQUEIDENTIFIER PRIMARY KEY, Name NVARCHAR(255) null, Title NVARCHAR(255) null, Database Company NVARCHAR(255) null, Biography NVARCHAR(255) null )
  • 141. Generating code public partial class SpeakerRepository : RepositoryBase<SpeakerEntity> { } Repositories
  • 142. Generating code public partial class SpeakerEntity { [XmlElement("Name")] public string Name { get; set; } [XmlElement("Title")] public string Title { get; set; } Entities [XmlElement("Company")] public string Company { get; set; } [XmlElement("Biography")] public string Biography { get; set; } }
  • 143. public partial class SpeakerModel : Model<SpeakerEntity Generating code { public string Name { get { return this._Name; } set { if (Name != value) { this.OnNameChanging(value); Models this._Name = value; this.OnNameChanged(); this.OnPropertyChanged("Name"); } } } private string _Name; partial void OnNameChanging(string value); partial void OnNameChanged(); ... }
  • 144. public class SpeakerReadEntityViewModel : ReadEntityViewModel<SpeakerModel, SpeakerEntity> Generating code { public override ICommand ReadCommand { get { return new MvxRelayCommand(() => RequestNavigate<SpeakerReadEntityViewModel>(new SpeakerModelParameters() { Id = Data.Id })); } } Viewmodels public override ICommand EditCommand { get { return new MvxRelayCommand(() => RequestNavigate<SpeakerUpdateEntityViewModel>( new SpeakerModelParameters() { Id = Data.Id )); } } }
  • 145. Generate windows views <Grid x:Name="ContentPanel" > <ScrollViewer > <StackPanel x:Name="SpeakerPanel" DataContext="{Binding Data}"> <TextBlock Text="{Binding ID}"/> <TextBlock Text="Name" /> <TextBlock Text="{Binding Name}"/> <TextBlock Text="Title"/> <TextBlock Text="{Binding Title}" /> <TextBlock Text="Company" /> <TextBlock Text="{Binding Company}" /> <TextBlock Text="Biography"/> <TextBlock x:Name="Biography" Text="{Binding Biography}" TextWrapping="Wrap" /> </StackPanel> </ScrollViewer> </Grid >
  • 146. Generate android views <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:text="Name"/> <TextView local:MvxBind="Text Data.Name" /> <TextView android:text="Title"/> <TextView local:MvxBind="Text Data.Title"/> <TextView android:text="Company" /> <TextView local:MvxBind="Path Data.Company"/> <TextView android:text="Biography"/> <TextView local:MvxBind="Text Data.Biography"/> </LinearLayout> </ScrollView>
  • 147. Generate iOS views public class SpeakerView: MvxTouchDialogViewController<SpeakerReadEntityViewModel> { public override void ViewDidAppear (bool animated) { base.ViewDidAppear (animated); ResetDisplay(); } private void ResetDisplay() { this.Root = new RootElement("Speaker Info") { new Section("Contact Info") { new StringElement("ID").Bind(this, "Value Data.Id"), new StringElement("Name").Bind(this, "Value Data.Name"), new StringElement("Title").Bind(this, "Value Data.Title"), new StringElement("Company").Bind(this, "Value Data.Company"), } }; } }
  • 149. Adding a property Generate Windows views Expand entities Generate entities Generate iOs views Expand views Designs Conference.Core Generate Android views
  • 150. Generator Base Designs Compilers Apps s Shared Domain Entities Microsoft Windows MvvmCross UX Views Xamarin Android TeaLight Style T4 Stores iOS
  • 151. Generator Base Designs Compilers Apps s MvvmCross 80
  • 152. Generator Base Designs Compilers Apps s <Entity Name="Speakers"> <StringProperty Name="Name" /> <DoubleProperty Name="Rate" /> <ImageProperty Name="Picture" /> </Entity>
  • 153. Generator Base Designs Compilers Apps s Templates T4 Renderers Flexible
  • 154. Generator Base Designs Compilers Apps s
  • 155. Generator Base Designs Compilers Apps s