SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Introduction to 
Xamarin.Forms 
Presented to the! 
Indianapolis .NET Mobile ! 
Developers Group,! 
by Brad Pillow! 
PillowSoft LLC
Presentation 
First Xamarin’s Forms Overview 
A bit more on Xamarin.Forms… 
2
Xamarin + Xamarin.Forms 
With Xamarin.Forms: 
more code-sharing, native controls 
Traditional Xamarin approach 
Shared UI Code
What’s Included 
▪ 40+ Pages, Layouts, and Controls 
▪ Build from code behind or XAML 
! 
▪ Two-way Data Binding 
! 
▪ Navigation 
! 
▪ Animation API 
! 
▪ Dependency Service 
! 
▪ Messaging Center 
! 
Shared UI Code
Pages 
Content MasterDetail Navigation Tabbed Carousel
Layouts 
Stack Absolute Relative Grid ContentView ScrollView Frame 
A bit like AutoLayout on iOS Only used as a base class
Controls 
ActivityIndicator BoxView Button DatePicker Editor 
Entry Image Label ListView Map 
OpenGLView Picker ProgressBar SearchBar Slider 
Stepper TableView TimePicker WebView EntryCell 
ImageCell SwitchCell TextCell ViewCell
DEMO 1 
Displaying List of Data
Model-View-ViewModel 
Data 
View ViewModel Model 
How to display 
information 
What to display 
Flow of interaction 
Business Logic 
Data objects 
Events 
Data
Model-View-ViewModel 
Data 
View ViewModel Model 
Events 
Xamarin.Forms 
Data Binding
Data Binding
Data Binding
Data Binding
Data Binding
DEMO 2 
Stocks App 
www.github.com/JamesMontemagno/MyStocks.Forms
Extensibility 
▪ Custom Renderer 
▪ Easily subclass any control you wish to 
customize. 
▪ Add your own custom controls. 
▪ Add custom bindable properties 
!! 
http://developer.xamarin.com/guides/cross-platform/ 
xamarin-forms/custom-renderer/
Extensibility 
▪ Standard Entry Control 
!!
Extensibility 
▪ Step 1: Custom Xamarin.Forms Control 
! 
! 
! 
! 
!!
Extensibility 
▪ Step 2: Use Custom Control in our shared Pages 
! 
! 
! 
! 
!!
Extensibility 
▪ Step 3: Implement Custom Renderer 
! 
! 
! 
! 
!!
Extensibility 
▪ Step 4: Export Renderer 
! 
! 
! 
! 
!!
Extensibility 
▪ Dependency Service 
▪ Lets shared code access platform-specific SDK features via an 
Interface implementation 
▪ B.Pillow Note: This is more commonly know as the “Service Locator” 
pattern. Not to be confused with dependency injection. 
!!
Extensibility 
▪ Step 1: Interface 
!!
Extensibility 
▪ Step 2: Implement on each Platform
Extensibility 
▪ Step 3: Register with Dependency Service 
* B.Pillow Note: Finally, add this [assembly] attribute above 
the class (and outside any namespaces that have been 
defined), including any required using statements.
Extensibility 
▪ Step 4: Access from shared code 
* B.Pillow Note: If you need more than service location/ 
injection, like full IOC, then there area number of 
adapters for Xamarin.Forms for other IOC frameworks.
DEMO 3 
Stocks App + 
Text to Speech 
www.github.com/JamesMontemagno/MyStocks.Forms
Animations API
www.github.com/JamesMontemagno/FormsAnimations
www.github.com/JamesMontemagno/FormsAnimations
Navigation 
▪ Root Page: 
▪ NavigationPage – Gives each page an INavigation 
! 
! 
▪ Standard Navigation 
▪ Navigation.PushAsync(page: nextPage); 
▪ Navigation.PopAsync(); 
! 
▪ Modal Navigation 
▪ Navigation.PushModalAsync(page: modalPage); 
▪ Navigation.PopModalAsync(); 
!!
Messaging Center 
▪ MessagingCenter.Subscribe<T>(object subscriber, string message, Action<T> callback); 
! 
▪ MessagingCenter.Send(T item, string message); 
! 
!!
Messaging Center 
▪ Master Page: 
!!!!!!!! 
▪ Detail Page: 
!
Resources 
▪ Documentation 
▪ http://developer.xamarin.com/guides/cross-platform/xamarin-forms/ 
! 
▪ XAML Documentation 
▪ http://developer.xamarin.com/guides/cross-platform/xamarin-forms/ 
xaml-for-xamarin-forms/ 
! 
▪ Samples 
▪ https://github.com/xamarin/xamarin-forms-samples 
!!!
Beyond The Intro
MVVM 
▪ MVVM Approaches 
▪ ReactiveUI - MVVM via Reactive Extensions (Rx) - https://github.com/ 
reactiveui/ReactiveUI 
▪ MvvmCross with Xamarin.Forms Example - https://github.com/ 
Cheesebaron/Xam.Forms.Mvx 
▪ FodyWeavers - PropertyChangedNotification Weaving - http:// 
arteksoftware.com/fody-propertychanged-xamarin-studio/ 
▪ MVVM Light - http://blog.falafel.com/learning-xamarin-mvvm-light-xamarin-forms/ 
▪ Tamarin (F# only, really MVC) - https://github.com/fsprojects/Tamarin 
! 
!!!
Example code 
▪ Run Tracker (CoreLocation, SQLite, RelativeLayout) - https://github.com/ 
alt234/simple-run 
▪ Xamarin Control Cheat Sheet - http://blog.xamarin.com/cheat-sheet-for-top- 
mobile-app-controls/ 
▪ Drawit - https://github.com/MitchMilam/Drawit/tree/master 
▪ CrossChat - chat application - https://github.com/EgorBo/CrossChat- 
Xamarin.Forms 
▪ XamarinFormsReactiveUIExample - https://github.com/damiensawyer/ 
XamarinFormsReactiveUIExample 
▪ Xamarin.Forms Programming in F# - http://www.knowing.net/index.php/ 
2014/08/27/xamarin-forms-programming-in-f/ 
! 
! 
!!
Useful PCL Libraries 
▪ Splat - x-platform geometry and mage handling - https://github.com/ 
paulcbetts/splat 
▪ Akavache - asynchronous, persistent key-value store- https:// 
github.com/akavache/Akavache 
▪ Fody - Extensible tool for weaving .net assemblies- https://github.com/ 
Fody/Fody 
▪ System.Drawing - cross-platform - not ready for prim time - https:// 
github.com/mono/sysdrawing-coregraphics 
▪ Fusillade - An opinionated HTTP library - https://github.com/paulcbetts/ 
fusillade 
! 
! 
!!!
Tips 
▪ The Bait and Switch PCL Trick - http://log.paulbetts.org/the-bait-and-switch- 
pcl-trick/ 
▪ Platform Tweaks - very handy - http://developer.xamarin.com/guides/cross-platform/ 
xamarin-forms/working-with/platform-specifics/ 
! 
!! 
!!! 
Device.OnPlatform( 
Android: () =>{ 
PositiveBalance = PositiveBalance.AddLuminosity(0.3); 
NegativeBalance = NegativeBalance.AddLuminosity(0.3); 
SubTitle = Color.FromRgb(115, 129, 130); 
}, 
WinPhone: () =>{ 
PositiveBalance = PositiveBalance.AddLuminosity(0.3); 
NegativeBalance = NegativeBalance.AddLuminosity(0.3); 
} 
);
Xamarin-Forms-Labs - Part 1 
Available controls 
Calendar Control (beta) 
ExtendedTabbedPage 
ImageButton (beta) 
ExtendedLabel (beta) 
ExtendedEntry (IOS) 
ExtendedViewCell (beta) 
ExtendedTextCell (beta) 
AutoComplete (beta) 
HybridWebView (alpha) 
Web Image (beta) 
GridView (IOS beta) 
RepeaterView (beta) 
SegmentedControlView (IOS beta) 
ExtendedScrollView (IOS beta) 
DynamicListView (beta) 
ExtendedContentView (beta) 
IconButton (IOS beta) 
Available services (Beta) 
Text To Speech 
Device (battery info, device info, sensors, accelerometers) 
Phone Service (cellular network info, make phone calls) 
Geolocator 
Camera (Picture and Video picker, Take Picture, Take Video) 
Accelerometer 
Display 
Cache 
SoundService 
Available Mvvm helpers (Beta) 
Calendar Control (beta) 
ExtendedTabbedPage 
ImageButton (beta) 
ExtendedLabel (beta) 
ExtendedEntry (IOS) 
ExtendedViewCell (beta) 
ExtendedTextCell (beta) 
AutoComplete (beta) 
HybridWebView (alpha) 
Web Image (beta) 
GridView (IOS beta) 
RepeaterView (beta) 
SegmentedControlView (IOS beta) 
ExtendedScrollView (IOS beta) 
DynamicListView (beta) 
ExtendedContentView (beta) 
IconButton (IOS beta)
Xamarin-Forms-Labs - Part 2 
Available Plugins (Beta) 
Serialization (ServiceStackV3, ProtoBuf, JSON.Net) 
Caching (SQLLiteSimpleCache) 
Dependency Injection containers (TinyIOC, Autofac, NInject, SimpleInjector, Unity) 
Web (RestClient) 
Charting (Line, Bar & Pie) (Alpha) 
https://github.com/XForms/Xamarin-Forms-Labs
C# Video Demo
C# Video Demo
F# And Xamarin.Forms 
Need latest version of Xamarin Studio 
Need latest F# plugin 
No templates yet, so clone this github project and modify the project xml by hand 
Use the beta PCL 78 F# Core 
Link to the facade assemblies for Monotouch, these vector PCL calls to correct namespaces in 
platform dll’s 
See this blog post: http://www.knowing.net/index.php/2014/08/27/xamarin-forms-programming-in-f/ 
If you do the above incorrectly, you will get errors with things like INotifyPropertyChanged not 
found, etc. 
No “shared projects” for F# yet, for now use combo of native and PCL
F# Example 
namespace FSXF1 
open System 
open MonoTouch.UIKit 
open MonoTouch.Foundation 
open Xamarin.Forms 
type App = class 
static member GetMainPage = 
let lbl = new Label() 
lbl.Text <- "Hello, F# Xam.Forms!" 
lbl.VerticalOptions <- LayoutOptions.CenterAndExpand 
lbl.HorizontalOptions <- LayoutOptions.CenterAndExpand 
let cp = new ContentPage() 
cp.Content <- lbl 
cp 
end 
[<Register("AppDelegate")>] 
type AppDelegate() = 
inherit UIApplicationDelegate() 
member val Window = null with get, set 
// This method is invoked when the application is ready to run. 
override this.FinishedLaunching(app, options) = 
this.Window <- new UIWindow(UIScreen.MainScreen.Bounds) 
Forms.Init() 
this.Window.RootViewController <- App.GetMainPage.CreateViewController() 
this.Window.MakeKeyAndVisible() 
true 
module Main = 
[<EntryPoint>] 
let main args = 
UIApplication.Main(args, null, "AppDelegate") 
0 (from: http://www.knowing.net/index.php/2014/08/27/xamarin-forms-programming-in-f/)
Find Me: 
@BradPillow | www.pillowsoft.com 
presentations@pillowsoft.com 
photo 
Q & A

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Xamarin.Forms and Lessons Learnt
Introduction to Xamarin.Forms and Lessons LearntIntroduction to Xamarin.Forms and Lessons Learnt
Introduction to Xamarin.Forms and Lessons LearntMichael Ridland
 
Visual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.FormsVisual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.FormsJames Montemagno
 
Lessons Learned: 4 Months of Xamarin.Forms
Lessons Learned: 4 Months of Xamarin.FormsLessons Learned: 4 Months of Xamarin.Forms
Lessons Learned: 4 Months of Xamarin.FormsEric Polerecky
 
What's new in Xamarin.Forms?
What's new in Xamarin.Forms?What's new in Xamarin.Forms?
What's new in Xamarin.Forms?James Montemagno
 
Designing cross-platform User Interface with native performance using Xamarin...
Designing cross-platform User Interface with native performance using Xamarin...Designing cross-platform User Interface with native performance using Xamarin...
Designing cross-platform User Interface with native performance using Xamarin...Pranav Ainavolu
 
Connected & Disconnected Apps with Xamarin
Connected & Disconnected Apps with XamarinConnected & Disconnected Apps with Xamarin
Connected & Disconnected Apps with XamarinRui Marinho
 
Getting hands on with xaml and xamarin
Getting hands on with xaml and xamarinGetting hands on with xaml and xamarin
Getting hands on with xaml and xamarinMitchell Muenster
 
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.FormsDeep Dive in Xamarin.Forms
Deep Dive in Xamarin.FormsJames Montemagno
 
Introduction to Xamarin 3 Seattle Mobile .NET Developers Group
Introduction to Xamarin 3 Seattle Mobile .NET Developers GroupIntroduction to Xamarin 3 Seattle Mobile .NET Developers Group
Introduction to Xamarin 3 Seattle Mobile .NET Developers GroupJames Montemagno
 
Xamarin Roadshow
Xamarin RoadshowXamarin Roadshow
Xamarin RoadshowSam Basu
 
Dallas Android - Android & iOS Development in C# with Xamarin
Dallas Android - Android & iOS Development in C# with XamarinDallas Android - Android & iOS Development in C# with Xamarin
Dallas Android - Android & iOS Development in C# with XamarinJames Montemagno
 
Flying High with Xamarin!
Flying High with Xamarin!Flying High with Xamarin!
Flying High with Xamarin!Sam Basu
 
ANUG - intro to Xamarin and Xamarin.Forms
ANUG - intro to Xamarin and Xamarin.FormsANUG - intro to Xamarin and Xamarin.Forms
ANUG - intro to Xamarin and Xamarin.FormsJames Montemagno
 
Introduction to Mobile Development with Xamarin -DotNet Westide
Introduction to Mobile Development with Xamarin -DotNet WestideIntroduction to Mobile Development with Xamarin -DotNet Westide
Introduction to Mobile Development with Xamarin -DotNet WestideJames Montemagno
 
Highlights from the Xamarin Evolve 2016 conference
Highlights from the Xamarin Evolve 2016 conferenceHighlights from the Xamarin Evolve 2016 conference
Highlights from the Xamarin Evolve 2016 conferenceChristopher Miller
 
Xamarin.Forms: a cross-platform mobile UI toolkit - ConFoo 2016
Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016
Xamarin.Forms: a cross-platform mobile UI toolkit - ConFoo 2016Guy Barrette
 
Xamarin overview droidcon.tn
Xamarin overview   droidcon.tnXamarin overview   droidcon.tn
Xamarin overview droidcon.tnHoussem Dellai
 

Was ist angesagt? (20)

Introduction to Xamarin.Forms and Lessons Learnt
Introduction to Xamarin.Forms and Lessons LearntIntroduction to Xamarin.Forms and Lessons Learnt
Introduction to Xamarin.Forms and Lessons Learnt
 
Visual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.FormsVisual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.Forms
 
Lessons Learned: 4 Months of Xamarin.Forms
Lessons Learned: 4 Months of Xamarin.FormsLessons Learned: 4 Months of Xamarin.Forms
Lessons Learned: 4 Months of Xamarin.Forms
 
What's new in Xamarin.Forms?
What's new in Xamarin.Forms?What's new in Xamarin.Forms?
What's new in Xamarin.Forms?
 
Designing cross-platform User Interface with native performance using Xamarin...
Designing cross-platform User Interface with native performance using Xamarin...Designing cross-platform User Interface with native performance using Xamarin...
Designing cross-platform User Interface with native performance using Xamarin...
 
Xamarin.Forms
Xamarin.FormsXamarin.Forms
Xamarin.Forms
 
Connected & Disconnected Apps with Xamarin
Connected & Disconnected Apps with XamarinConnected & Disconnected Apps with Xamarin
Connected & Disconnected Apps with Xamarin
 
Getting hands on with xaml and xamarin
Getting hands on with xaml and xamarinGetting hands on with xaml and xamarin
Getting hands on with xaml and xamarin
 
Deep Dive in Xamarin.Forms
Deep Dive in Xamarin.FormsDeep Dive in Xamarin.Forms
Deep Dive in Xamarin.Forms
 
Introduction to Xamarin 3 Seattle Mobile .NET Developers Group
Introduction to Xamarin 3 Seattle Mobile .NET Developers GroupIntroduction to Xamarin 3 Seattle Mobile .NET Developers Group
Introduction to Xamarin 3 Seattle Mobile .NET Developers Group
 
Xamarin Roadshow
Xamarin RoadshowXamarin Roadshow
Xamarin Roadshow
 
Dallas Android - Android & iOS Development in C# with Xamarin
Dallas Android - Android & iOS Development in C# with XamarinDallas Android - Android & iOS Development in C# with Xamarin
Dallas Android - Android & iOS Development in C# with Xamarin
 
Intro to Xamarin
Intro to XamarinIntro to Xamarin
Intro to Xamarin
 
Flying High with Xamarin!
Flying High with Xamarin!Flying High with Xamarin!
Flying High with Xamarin!
 
ANUG - intro to Xamarin and Xamarin.Forms
ANUG - intro to Xamarin and Xamarin.FormsANUG - intro to Xamarin and Xamarin.Forms
ANUG - intro to Xamarin and Xamarin.Forms
 
Introduction to Mobile Development with Xamarin -DotNet Westide
Introduction to Mobile Development with Xamarin -DotNet WestideIntroduction to Mobile Development with Xamarin -DotNet Westide
Introduction to Mobile Development with Xamarin -DotNet Westide
 
Highlights from the Xamarin Evolve 2016 conference
Highlights from the Xamarin Evolve 2016 conferenceHighlights from the Xamarin Evolve 2016 conference
Highlights from the Xamarin Evolve 2016 conference
 
Xamarin.Forms: a cross-platform mobile UI toolkit - ConFoo 2016
Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016
Xamarin.Forms: a cross-platform mobile UI toolkit - ConFoo 2016
 
Xamarin overview droidcon.tn
Xamarin overview   droidcon.tnXamarin overview   droidcon.tn
Xamarin overview droidcon.tn
 
Evolve 2014
Evolve 2014Evolve 2014
Evolve 2014
 

Ähnlich wie Introduction to Xamarin.Forms

extending-and-optimizing-xamarin-forms-apps
extending-and-optimizing-xamarin-forms-appsextending-and-optimizing-xamarin-forms-apps
extending-and-optimizing-xamarin-forms-appsMatthew Soucoup
 
App innovationcircles xamarin
App innovationcircles xamarinApp innovationcircles xamarin
App innovationcircles xamarinMohit Chhabra
 
Cross platform mobile app development with Xamarin
Cross platform mobile app development with XamarinCross platform mobile app development with Xamarin
Cross platform mobile app development with XamarinPranav Ainavolu
 
Robotlegs on Top of Gaia
Robotlegs on Top of GaiaRobotlegs on Top of Gaia
Robotlegs on Top of GaiaJesse Warden
 
Kickstart android development with xamarin
Kickstart android development with xamarinKickstart android development with xamarin
Kickstart android development with xamarinFoyzul Karim
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsNish Anil
 
How To: Mobile "Hello World" With Xamarin and Visual Studio 2013
How To: Mobile "Hello World" With Xamarin and Visual Studio 2013How To: Mobile "Hello World" With Xamarin and Visual Studio 2013
How To: Mobile "Hello World" With Xamarin and Visual Studio 2013IndyMobileNetDev
 
How To: Mobile "Hello World" With Xamarin and VS-2013
How To: Mobile "Hello World" With Xamarin and VS-2013How To: Mobile "Hello World" With Xamarin and VS-2013
How To: Mobile "Hello World" With Xamarin and VS-2013Brad Pillow
 
SharePoint Mobile App Development with Xmarin
SharePoint Mobile App Development with XmarinSharePoint Mobile App Development with Xmarin
SharePoint Mobile App Development with XmarinHector Luciano Jr
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekDr. Felix Raab
 
Optimizing and Extending Xamarin.Forms iOS, Android, and UWP Apps
Optimizing and Extending Xamarin.Forms iOS, Android, and UWP AppsOptimizing and Extending Xamarin.Forms iOS, Android, and UWP Apps
Optimizing and Extending Xamarin.Forms iOS, Android, and UWP AppsJames Montemagno
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0Thomas Conté
 
Serverless Computing with Azure Functions and Xamarin
Serverless Computing with Azure Functions and XamarinServerless Computing with Azure Functions and Xamarin
Serverless Computing with Azure Functions and XamarinMark Arteaga
 
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and BeyondState of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and BeyondNick Landry
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
VS Saturday 2019 - Xamarin.Forms 4.x
VS Saturday 2019 - Xamarin.Forms 4.xVS Saturday 2019 - Xamarin.Forms 4.x
VS Saturday 2019 - Xamarin.Forms 4.xMarco Bortolin
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightFrank La Vigne
 
20141216 멜팅팟 부산 세션 ii - cross platform 개발
20141216 멜팅팟 부산   세션 ii - cross platform 개발20141216 멜팅팟 부산   세션 ii - cross platform 개발
20141216 멜팅팟 부산 세션 ii - cross platform 개발영욱 김
 

Ähnlich wie Introduction to Xamarin.Forms (20)

extending-and-optimizing-xamarin-forms-apps
extending-and-optimizing-xamarin-forms-appsextending-and-optimizing-xamarin-forms-apps
extending-and-optimizing-xamarin-forms-apps
 
App innovationcircles xamarin
App innovationcircles xamarinApp innovationcircles xamarin
App innovationcircles xamarin
 
Cross platform mobile app development with Xamarin
Cross platform mobile app development with XamarinCross platform mobile app development with Xamarin
Cross platform mobile app development with Xamarin
 
Robotlegs on Top of Gaia
Robotlegs on Top of GaiaRobotlegs on Top of Gaia
Robotlegs on Top of Gaia
 
Xamarin 101
Xamarin 101Xamarin 101
Xamarin 101
 
Kickstart android development with xamarin
Kickstart android development with xamarinKickstart android development with xamarin
Kickstart android development with xamarin
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.Forms
 
How To: Mobile "Hello World" With Xamarin and Visual Studio 2013
How To: Mobile "Hello World" With Xamarin and Visual Studio 2013How To: Mobile "Hello World" With Xamarin and Visual Studio 2013
How To: Mobile "Hello World" With Xamarin and Visual Studio 2013
 
How To: Mobile "Hello World" With Xamarin and VS-2013
How To: Mobile "Hello World" With Xamarin and VS-2013How To: Mobile "Hello World" With Xamarin and VS-2013
How To: Mobile "Hello World" With Xamarin and VS-2013
 
SharePoint Mobile App Development with Xmarin
SharePoint Mobile App Development with XmarinSharePoint Mobile App Development with Xmarin
SharePoint Mobile App Development with Xmarin
 
Cascade
CascadeCascade
Cascade
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
 
Optimizing and Extending Xamarin.Forms iOS, Android, and UWP Apps
Optimizing and Extending Xamarin.Forms iOS, Android, and UWP AppsOptimizing and Extending Xamarin.Forms iOS, Android, and UWP Apps
Optimizing and Extending Xamarin.Forms iOS, Android, and UWP Apps
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
Serverless Computing with Azure Functions and Xamarin
Serverless Computing with Azure Functions and XamarinServerless Computing with Azure Functions and Xamarin
Serverless Computing with Azure Functions and Xamarin
 
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and BeyondState of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
VS Saturday 2019 - Xamarin.Forms 4.x
VS Saturday 2019 - Xamarin.Forms 4.xVS Saturday 2019 - Xamarin.Forms 4.x
VS Saturday 2019 - Xamarin.Forms 4.x
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
 
20141216 멜팅팟 부산 세션 ii - cross platform 개발
20141216 멜팅팟 부산   세션 ii - cross platform 개발20141216 멜팅팟 부산   세션 ii - cross platform 개발
20141216 멜팅팟 부산 세션 ii - cross platform 개발
 

Mehr von Brad Pillow

GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay ModernBrad Pillow
 
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay ModernBrad Pillow
 
GraphQL With Relay Part Deux
GraphQL With Relay Part DeuxGraphQL With Relay Part Deux
GraphQL With Relay Part DeuxBrad Pillow
 
GraphQL IndyJS April 2016
GraphQL IndyJS April 2016GraphQL IndyJS April 2016
GraphQL IndyJS April 2016Brad Pillow
 
Life In The Fast Lane: August 2014 Indy QS Meetup Presentation
Life In The Fast Lane: August 2014 Indy QS Meetup PresentationLife In The Fast Lane: August 2014 Indy QS Meetup Presentation
Life In The Fast Lane: August 2014 Indy QS Meetup PresentationBrad Pillow
 
F# and Reactive Programming for iOS
F# and Reactive Programming for iOSF# and Reactive Programming for iOS
F# and Reactive Programming for iOSBrad Pillow
 

Mehr von Brad Pillow (6)

GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern
 
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern
 
GraphQL With Relay Part Deux
GraphQL With Relay Part DeuxGraphQL With Relay Part Deux
GraphQL With Relay Part Deux
 
GraphQL IndyJS April 2016
GraphQL IndyJS April 2016GraphQL IndyJS April 2016
GraphQL IndyJS April 2016
 
Life In The Fast Lane: August 2014 Indy QS Meetup Presentation
Life In The Fast Lane: August 2014 Indy QS Meetup PresentationLife In The Fast Lane: August 2014 Indy QS Meetup Presentation
Life In The Fast Lane: August 2014 Indy QS Meetup Presentation
 
F# and Reactive Programming for iOS
F# and Reactive Programming for iOSF# and Reactive Programming for iOS
F# and Reactive Programming for iOS
 

Kürzlich hochgeladen

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 

Kürzlich hochgeladen (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 

Introduction to Xamarin.Forms

  • 1. Introduction to Xamarin.Forms Presented to the! Indianapolis .NET Mobile ! Developers Group,! by Brad Pillow! PillowSoft LLC
  • 2. Presentation First Xamarin’s Forms Overview A bit more on Xamarin.Forms… 2
  • 3. Xamarin + Xamarin.Forms With Xamarin.Forms: more code-sharing, native controls Traditional Xamarin approach Shared UI Code
  • 4. What’s Included ▪ 40+ Pages, Layouts, and Controls ▪ Build from code behind or XAML ! ▪ Two-way Data Binding ! ▪ Navigation ! ▪ Animation API ! ▪ Dependency Service ! ▪ Messaging Center ! Shared UI Code
  • 5. Pages Content MasterDetail Navigation Tabbed Carousel
  • 6. Layouts Stack Absolute Relative Grid ContentView ScrollView Frame A bit like AutoLayout on iOS Only used as a base class
  • 7. Controls ActivityIndicator BoxView Button DatePicker Editor Entry Image Label ListView Map OpenGLView Picker ProgressBar SearchBar Slider Stepper TableView TimePicker WebView EntryCell ImageCell SwitchCell TextCell ViewCell
  • 8. DEMO 1 Displaying List of Data
  • 9. Model-View-ViewModel Data View ViewModel Model How to display information What to display Flow of interaction Business Logic Data objects Events Data
  • 10. Model-View-ViewModel Data View ViewModel Model Events Xamarin.Forms Data Binding
  • 15. DEMO 2 Stocks App www.github.com/JamesMontemagno/MyStocks.Forms
  • 16.
  • 17. Extensibility ▪ Custom Renderer ▪ Easily subclass any control you wish to customize. ▪ Add your own custom controls. ▪ Add custom bindable properties !! http://developer.xamarin.com/guides/cross-platform/ xamarin-forms/custom-renderer/
  • 18. Extensibility ▪ Standard Entry Control !!
  • 19. Extensibility ▪ Step 1: Custom Xamarin.Forms Control ! ! ! ! !!
  • 20. Extensibility ▪ Step 2: Use Custom Control in our shared Pages ! ! ! ! !!
  • 21. Extensibility ▪ Step 3: Implement Custom Renderer ! ! ! ! !!
  • 22. Extensibility ▪ Step 4: Export Renderer ! ! ! ! !!
  • 23. Extensibility ▪ Dependency Service ▪ Lets shared code access platform-specific SDK features via an Interface implementation ▪ B.Pillow Note: This is more commonly know as the “Service Locator” pattern. Not to be confused with dependency injection. !!
  • 24. Extensibility ▪ Step 1: Interface !!
  • 25. Extensibility ▪ Step 2: Implement on each Platform
  • 26. Extensibility ▪ Step 3: Register with Dependency Service * B.Pillow Note: Finally, add this [assembly] attribute above the class (and outside any namespaces that have been defined), including any required using statements.
  • 27. Extensibility ▪ Step 4: Access from shared code * B.Pillow Note: If you need more than service location/ injection, like full IOC, then there area number of adapters for Xamarin.Forms for other IOC frameworks.
  • 28. DEMO 3 Stocks App + Text to Speech www.github.com/JamesMontemagno/MyStocks.Forms
  • 31.
  • 32.
  • 33.
  • 35. Navigation ▪ Root Page: ▪ NavigationPage – Gives each page an INavigation ! ! ▪ Standard Navigation ▪ Navigation.PushAsync(page: nextPage); ▪ Navigation.PopAsync(); ! ▪ Modal Navigation ▪ Navigation.PushModalAsync(page: modalPage); ▪ Navigation.PopModalAsync(); !!
  • 36. Messaging Center ▪ MessagingCenter.Subscribe<T>(object subscriber, string message, Action<T> callback); ! ▪ MessagingCenter.Send(T item, string message); ! !!
  • 37. Messaging Center ▪ Master Page: !!!!!!!! ▪ Detail Page: !
  • 38. Resources ▪ Documentation ▪ http://developer.xamarin.com/guides/cross-platform/xamarin-forms/ ! ▪ XAML Documentation ▪ http://developer.xamarin.com/guides/cross-platform/xamarin-forms/ xaml-for-xamarin-forms/ ! ▪ Samples ▪ https://github.com/xamarin/xamarin-forms-samples !!!
  • 40. MVVM ▪ MVVM Approaches ▪ ReactiveUI - MVVM via Reactive Extensions (Rx) - https://github.com/ reactiveui/ReactiveUI ▪ MvvmCross with Xamarin.Forms Example - https://github.com/ Cheesebaron/Xam.Forms.Mvx ▪ FodyWeavers - PropertyChangedNotification Weaving - http:// arteksoftware.com/fody-propertychanged-xamarin-studio/ ▪ MVVM Light - http://blog.falafel.com/learning-xamarin-mvvm-light-xamarin-forms/ ▪ Tamarin (F# only, really MVC) - https://github.com/fsprojects/Tamarin ! !!!
  • 41. Example code ▪ Run Tracker (CoreLocation, SQLite, RelativeLayout) - https://github.com/ alt234/simple-run ▪ Xamarin Control Cheat Sheet - http://blog.xamarin.com/cheat-sheet-for-top- mobile-app-controls/ ▪ Drawit - https://github.com/MitchMilam/Drawit/tree/master ▪ CrossChat - chat application - https://github.com/EgorBo/CrossChat- Xamarin.Forms ▪ XamarinFormsReactiveUIExample - https://github.com/damiensawyer/ XamarinFormsReactiveUIExample ▪ Xamarin.Forms Programming in F# - http://www.knowing.net/index.php/ 2014/08/27/xamarin-forms-programming-in-f/ ! ! !!
  • 42. Useful PCL Libraries ▪ Splat - x-platform geometry and mage handling - https://github.com/ paulcbetts/splat ▪ Akavache - asynchronous, persistent key-value store- https:// github.com/akavache/Akavache ▪ Fody - Extensible tool for weaving .net assemblies- https://github.com/ Fody/Fody ▪ System.Drawing - cross-platform - not ready for prim time - https:// github.com/mono/sysdrawing-coregraphics ▪ Fusillade - An opinionated HTTP library - https://github.com/paulcbetts/ fusillade ! ! !!!
  • 43. Tips ▪ The Bait and Switch PCL Trick - http://log.paulbetts.org/the-bait-and-switch- pcl-trick/ ▪ Platform Tweaks - very handy - http://developer.xamarin.com/guides/cross-platform/ xamarin-forms/working-with/platform-specifics/ ! !! !!! Device.OnPlatform( Android: () =>{ PositiveBalance = PositiveBalance.AddLuminosity(0.3); NegativeBalance = NegativeBalance.AddLuminosity(0.3); SubTitle = Color.FromRgb(115, 129, 130); }, WinPhone: () =>{ PositiveBalance = PositiveBalance.AddLuminosity(0.3); NegativeBalance = NegativeBalance.AddLuminosity(0.3); } );
  • 44. Xamarin-Forms-Labs - Part 1 Available controls Calendar Control (beta) ExtendedTabbedPage ImageButton (beta) ExtendedLabel (beta) ExtendedEntry (IOS) ExtendedViewCell (beta) ExtendedTextCell (beta) AutoComplete (beta) HybridWebView (alpha) Web Image (beta) GridView (IOS beta) RepeaterView (beta) SegmentedControlView (IOS beta) ExtendedScrollView (IOS beta) DynamicListView (beta) ExtendedContentView (beta) IconButton (IOS beta) Available services (Beta) Text To Speech Device (battery info, device info, sensors, accelerometers) Phone Service (cellular network info, make phone calls) Geolocator Camera (Picture and Video picker, Take Picture, Take Video) Accelerometer Display Cache SoundService Available Mvvm helpers (Beta) Calendar Control (beta) ExtendedTabbedPage ImageButton (beta) ExtendedLabel (beta) ExtendedEntry (IOS) ExtendedViewCell (beta) ExtendedTextCell (beta) AutoComplete (beta) HybridWebView (alpha) Web Image (beta) GridView (IOS beta) RepeaterView (beta) SegmentedControlView (IOS beta) ExtendedScrollView (IOS beta) DynamicListView (beta) ExtendedContentView (beta) IconButton (IOS beta)
  • 45. Xamarin-Forms-Labs - Part 2 Available Plugins (Beta) Serialization (ServiceStackV3, ProtoBuf, JSON.Net) Caching (SQLLiteSimpleCache) Dependency Injection containers (TinyIOC, Autofac, NInject, SimpleInjector, Unity) Web (RestClient) Charting (Line, Bar & Pie) (Alpha) https://github.com/XForms/Xamarin-Forms-Labs
  • 48. F# And Xamarin.Forms Need latest version of Xamarin Studio Need latest F# plugin No templates yet, so clone this github project and modify the project xml by hand Use the beta PCL 78 F# Core Link to the facade assemblies for Monotouch, these vector PCL calls to correct namespaces in platform dll’s See this blog post: http://www.knowing.net/index.php/2014/08/27/xamarin-forms-programming-in-f/ If you do the above incorrectly, you will get errors with things like INotifyPropertyChanged not found, etc. No “shared projects” for F# yet, for now use combo of native and PCL
  • 49. F# Example namespace FSXF1 open System open MonoTouch.UIKit open MonoTouch.Foundation open Xamarin.Forms type App = class static member GetMainPage = let lbl = new Label() lbl.Text <- "Hello, F# Xam.Forms!" lbl.VerticalOptions <- LayoutOptions.CenterAndExpand lbl.HorizontalOptions <- LayoutOptions.CenterAndExpand let cp = new ContentPage() cp.Content <- lbl cp end [<Register("AppDelegate")>] type AppDelegate() = inherit UIApplicationDelegate() member val Window = null with get, set // This method is invoked when the application is ready to run. override this.FinishedLaunching(app, options) = this.Window <- new UIWindow(UIScreen.MainScreen.Bounds) Forms.Init() this.Window.RootViewController <- App.GetMainPage.CreateViewController() this.Window.MakeKeyAndVisible() true module Main = [<EntryPoint>] let main args = UIApplication.Main(args, null, "AppDelegate") 0 (from: http://www.knowing.net/index.php/2014/08/27/xamarin-forms-programming-in-f/)
  • 50. Find Me: @BradPillow | www.pillowsoft.com presentations@pillowsoft.com photo Q & A