SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
XAML With Xamarin 
There 
Is 
Life 
A,er 
Death 
Jesse 
Liberty 
Master 
Consultant 
Falafel 
So5ware 
jesse@falafel.com 
@jesseliberty
What We Will Cover 
• Xamarin 
Forms 
and 
XAML 
• Data 
and 
Data 
Binding 
• MVVM
Am I In The Right Presenta:on? 
• I 
assume… 
• LiEle 
or 
no 
Xamarin 
Forms 
experience 
• Comfortable 
with 
C# 
• Familiar 
with 
XAML 
• Interested 
in 
Databinding 
• Interested 
in 
MVVM
Q&A 
at 
the 
end
This is not your mama's Xamarin! 
• Xamarin 
Forms 
are 
a 
whole 
new 
thing 
• Xamarin 
Forms 
are 
the 
future!* 
• For 
now, 
limited 
but 
extremely 
powerful 
• A 
natural 
migraMon 
for 
XAML 
programmers 
* 
Personal 
Opinion
What Is Xamarin? 
• Xamarin 
is 
a 
framework 
that 
allows 
you 
to 
create 
naMve 
iOS, 
Android, 
Windows 
Phone 
and 
Mac 
applicaMons 
in 
C#.
What Is Xamarin Forms? 
• Create 
naMve 
iOS, 
Android, 
WP 
applicaMons 
(UX) 
with 
shared 
code 
• XAML 
and/or 
C#
What Is Xamarin Studio? 
• An 
Integrated 
Development 
Environment 
(IDE) 
• Similar 
to 
Visual 
Studio 
• Runs 
on 
Mac 
and 
Windows
Your Development Environment 
• OpMon 
1: 
Mac 
only 
– 
Develop 
iOS 
and 
Android 
in 
Xamarin 
Studio 
• OpMon 
2: 
Parallels 
on 
Mac, 
Business 
license. 
Develop 
iOS, 
Android 
and 
Windows 
Phone 
in 
Visual 
Studio 
• OpMon 
3: 
Windows 
only 
– 
Develop 
Android 
and 
Windows 
Phone 
in 
Visual 
Studio 
or 
Xamarin 
Studio
XAML 
• Anything 
you 
can 
do 
in 
XAML 
you 
can 
do 
in 
C#. 
• But 
don't.
XAML and MVVM 
• You 
can 
do 
XAML 
without 
MVVM 
• But 
don't.
MVVM From The Start 
• Model: 
Your 
data 
• View: 
Your 
presentaMon 
(UI) 
• View-­‐Model: 
The 
glue 
• The 
logic 
goes 
in 
the 
VM
Why MVVM? 
• Proven 
paEern 
(WPF, 
Silverlight, 
etc.) 
• Especially 
lends 
itself 
to 
Xamarin 
Forms 
• Data 
binding 
• XAML 
• SeparaMon 
of 
concerns 
• Easier 
to 
maintain 
• Easier 
to 
test
C# && XAML 
• XAML 
is 
great 
because 
• DeclaraMve 
• Machine-­‐readable 
(designer?)
Data Binding 
• Rather 
than 
copying 
data 
to 
and 
from 
the 
user 
interface, 
we 
bind! 
• Bind 
from 
any 
object 
to 
any 
widget 
Data 
Source 
Data 
Control 
Binding
Element Binding 
• You 
can 
even 
bind 
from 
one 
control 
to 
another 
• Example: 
slider 
to 
label 
Data 
Label 
Slider 
Binding
Events 
• Assign 
event 
handlers 
• Handle 
in 
code-­‐behind 
• No 
support 
yet 
for 
binding 
events 
• Though 
there 
are 
libraries
Demo 
• CreaMng 
your 
first 
forms 
applicaMon 
• 3 
Projects 
• PCL 
• iOS 
• Android 
Demo 
1 
– 
New 
SoluMon
What we're going to build 
• Evaluator 
is 
a 
mobile 
applicaMon 
• Helps 
you 
compare 
items 
such 
as 
dishwashers 
• You 
can 
add 
criteria 
you 
care 
about 
• You 
set 
how 
important 
each 
is
Demo 
• First 
MVVM 
Xamarin 
Forms 
ApplicaMon 
• Goal: 
create 
a 
page 
that 
lists 
3 
items 
and 
their 
locaMon 
• Demo 
2
Being No:fied 
• How 
do 
we 
update 
the 
UI 
if 
the 
data 
changes? 
• Implement 
interface 
INoMfyPropertyChanged 
• Put 
our 
items 
in 
an 
ObservableCollecMon 
• Sound 
familiar?
Demo 
• Adding 
noMficaMon 
• Demo 
3
Views and More 
• Pages 
• Layouts 
• Views 
• Cells
Key Layouts We’ll Work With 
• StackLayout 
• GridLayout
Key Views We’ll Work With 
• Label 
(display 
text) 
• Entry 
(gather 
text) 
• ListView
Adding Views and Data 
• We 
want 
to 
add 
Criteria 
for 
each 
item 
• Each 
criterion 
has 
a 
name, 
a 
descripMon, 
an 
importance 
raMng 
and 
a 
raMng 
• Example: 
• Quiet 
• Higher 
values 
= 
quieter 
• Importance 
= 
5 
• RaMng 
=
Two New Views 
• Details 
page 
displays 
the 
criteria 
for 
a 
selected 
item 
• AddCriterion 
allows 
you 
to 
add 
new 
criteria 
for 
all 
items
Naviga:on 
• How 
do 
we 
go 
from 
one 
page 
to 
another? 
• How 
do 
we 
pass 
informaMon 
from 
one 
page 
to 
another?
Demo 
• Criteria 
• Details 
Page 
• Demo 
4
Demo 
• Fixing 
the 
integers 
• Forms 
provide 
strings 
• Storing 
numbers 
as 
strings 
is 
undesirable 
• SoluMon: 
IValueConverter 
• Demo 
5
Demo 
• Move 
the 
“Add 
criterion” 
buEon 
to 
the 
details 
page 
• Add 
“Add 
Item” 
to 
Items 
page 
• Create 
AddItemPage 
• Demo 
6
Tabbed Pages 
• As 
always, 
write 
to 
the 
abstracMon 
• Displays 
appropriate 
to 
the 
plamorm 
• In 
the 
MainPage.xaml: 
<TabbedPage.Children> 
<local:ItemsPage 
/> 
<local:HelpPage 
/> 
<local:LicensePage 
/> 
</TabbedPage.Children> 
Declare 
your 
tabbed 
pages 
Remember 
to 
create 
namespace
Demo 
• Create 
a 
new 
MainPage 
• Add 
tabbed 
Pages 
• 1st 
tab 
= 
Items 
• 2nd 
tab 
= 
Help 
• 3rd 
tab 
= 
License 
• Remember: 
Page 
type 
is 
TabbedPage 
• Demo 
7
Demo 
• Adding 
to 
toolbar 
• Drop/Seed 
DB 
• Demo 
8
Images 
• From 
• A 
file, 
A 
Uri, 
A 
Resource 
• Aspect 
• Fill, 
AspectFill, 
AspectFit 
• hEp://jliberty.me/dishwasherjpg
Maps 
• Using 
Map 
control 
• Sepng 
locaMon 
• Sepng 
MapType
Demo 
• Adding 
a 
map 
• Demo 
9
Custom Rendering 
• Remember 
that 
forms 
render 
naMvely 
• This 
is 
done 
with 
“Renderers” 
• You 
can 
write 
Custom 
Renderers
Demo 
• Custom 
Rendering 
• Demo 
10
Add icons 
• Evaluate
Ques:ons?
Contact Me 
• Jesse 
Liberty 
• Falafel 
So5ware 
• jesse@falafel.com 
• @jesseliberty

Contenu connexe

Tendances

Is it time to start using HTML 5
Is it time to start using HTML 5Is it time to start using HTML 5
Is it time to start using HTML 5
Ravi Raj
 

Tendances (20)

Ecommerce World, WooCommerce
Ecommerce World, WooCommerceEcommerce World, WooCommerce
Ecommerce World, WooCommerce
 
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
The Dawson Way of Doing Things: A Study of Our Path Using WordPressThe Dawson Way of Doing Things: A Study of Our Path Using WordPress
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
 
Migrating liverpool.gov.uk to Umbraco
Migrating liverpool.gov.uk to UmbracoMigrating liverpool.gov.uk to Umbraco
Migrating liverpool.gov.uk to Umbraco
 
Is it time to start using HTML 5
Is it time to start using HTML 5Is it time to start using HTML 5
Is it time to start using HTML 5
 
JavaScript Introduction
JavaScript IntroductionJavaScript Introduction
JavaScript Introduction
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEO
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11
 
RPA on Azure with .Net
RPA on Azure with .NetRPA on Azure with .Net
RPA on Azure with .Net
 
On the Move, Website Migrations Debunked
On the Move, Website Migrations DebunkedOn the Move, Website Migrations Debunked
On the Move, Website Migrations Debunked
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
 
Building Office 365 Apps with TypeScript
Building Office 365 Apps with TypeScriptBuilding Office 365 Apps with TypeScript
Building Office 365 Apps with TypeScript
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1
 
Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Ajax
AjaxAjax
Ajax
 
Elm a possible future for web frontend
Elm   a possible future for web frontendElm   a possible future for web frontend
Elm a possible future for web frontend
 
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
The Dawson Way of Doing Things: A Study of Our Path Using WordPressThe Dawson Way of Doing Things: A Study of Our Path Using WordPress
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
 
BIW15: Python in the Cloud: Django and Flaks
BIW15: Python in the Cloud: Django and FlaksBIW15: Python in the Cloud: Django and Flaks
BIW15: Python in the Cloud: Django and Flaks
 

En vedette

En vedette (12)

Formation C# & XAML
Formation C# & XAML Formation C# & XAML
Formation C# & XAML
 
Comparing xaml and html
Comparing xaml and htmlComparing xaml and html
Comparing xaml and html
 
Build your own Cloud/Home security system for 60$
Build your own Cloud/Home security system for 60$Build your own Cloud/Home security system for 60$
Build your own Cloud/Home security system for 60$
 
C sharp chap1
C sharp chap1C sharp chap1
C sharp chap1
 
Formation VB.NET
Formation VB.NETFormation VB.NET
Formation VB.NET
 
C#
C#C#
C#
 
Agile Retrospectives
Agile RetrospectivesAgile Retrospectives
Agile Retrospectives
 
C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#
 
C#
C#C#
C#
 
C# 3.0 and 4.0
C# 3.0 and 4.0C# 3.0 and 4.0
C# 3.0 and 4.0
 
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 

Similaire à XAML Development with Xamarin - Jesse Liberty | FalafelCON 2014

Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1
drudolph11
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
Jia Mi
 

Similaire à XAML Development with Xamarin - Jesse Liberty | FalafelCON 2014 (20)

Kickstart android development with xamarin
Kickstart android development with xamarinKickstart android development with xamarin
Kickstart android development with xamarin
 
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
 
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...
 
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
 
Getting started with Xamarin forms
Getting started with Xamarin formsGetting started with Xamarin forms
Getting started with Xamarin forms
 
Xamarin.Forms
Xamarin.FormsXamarin.Forms
Xamarin.Forms
 
Xamarin.Forms Bootcamp
Xamarin.Forms BootcampXamarin.Forms Bootcamp
Xamarin.Forms Bootcamp
 
Inland Empire .NET User's Group Silverlight Class
Inland Empire .NET User's Group Silverlight ClassInland Empire .NET User's Group Silverlight Class
Inland Empire .NET User's Group Silverlight Class
 
Xamarin.Forms or Write Once, Run Anywhere
Xamarin.Forms or Write Once, Run AnywhereXamarin.Forms or Write Once, Run Anywhere
Xamarin.Forms or Write Once, Run Anywhere
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
 
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
 
Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013
 
Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
Tech Talk on Cloud Computing
Tech Talk on Cloud ComputingTech Talk on Cloud Computing
Tech Talk on Cloud Computing
 
Vba Class Level 3
Vba Class Level 3Vba Class Level 3
Vba Class Level 3
 
CodeIgniter for Startups, cicon2010
CodeIgniter for Startups, cicon2010CodeIgniter for Startups, cicon2010
CodeIgniter for Startups, cicon2010
 

Plus de FalafelSoftware

Plus de FalafelSoftware (13)

Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
 
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
 
DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014
DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014
DDD with ASP.NET MVC - Steve Smith | FalafelCON 2014
 
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
 
Solving Mobile Test Automation Challenges with TestComplete - Nick Olivo | Fa...
Solving Mobile Test Automation Challenges with TestComplete - Nick Olivo | Fa...Solving Mobile Test Automation Challenges with TestComplete - Nick Olivo | Fa...
Solving Mobile Test Automation Challenges with TestComplete - Nick Olivo | Fa...
 
iBeacons for Everyone, from iOS to Android - James Montemagno | FalafelCON 2014
iBeacons for Everyone, from iOS to Android - James Montemagno | FalafelCON 2014iBeacons for Everyone, from iOS to Android - James Montemagno | FalafelCON 2014
iBeacons for Everyone, from iOS to Android - James Montemagno | FalafelCON 2014
 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
 
AngularJS and Kendo UI - Jesse Liberty | FalafelCON 2014
AngularJS and Kendo UI - Jesse Liberty | FalafelCON 2014AngularJS and Kendo UI - Jesse Liberty | FalafelCON 2014
AngularJS and Kendo UI - Jesse Liberty | FalafelCON 2014
 
Agile Patterns: Estimation - Stephen Forte | FalafelCON 2014
Agile Patterns: Estimation - Stephen Forte | FalafelCON 2014Agile Patterns: Estimation - Stephen Forte | FalafelCON 2014
Agile Patterns: Estimation - Stephen Forte | FalafelCON 2014
 
Mobile ASP.Net Web Forms - Making the impossible possible | FalafelCON 2014
Mobile ASP.Net Web Forms - Making the impossible possible | FalafelCON 2014Mobile ASP.Net Web Forms - Making the impossible possible | FalafelCON 2014
Mobile ASP.Net Web Forms - Making the impossible possible | FalafelCON 2014
 
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
 
Cloud and Azure and Rock and Roll
Cloud and Azure and Rock and RollCloud and Azure and Rock and Roll
Cloud and Azure and Rock and Roll
 
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
 

Dernier

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
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
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
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
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

XAML Development with Xamarin - Jesse Liberty | FalafelCON 2014

  • 1. XAML With Xamarin There Is Life A,er Death Jesse Liberty Master Consultant Falafel So5ware jesse@falafel.com @jesseliberty
  • 2. What We Will Cover • Xamarin Forms and XAML • Data and Data Binding • MVVM
  • 3. Am I In The Right Presenta:on? • I assume… • LiEle or no Xamarin Forms experience • Comfortable with C# • Familiar with XAML • Interested in Databinding • Interested in MVVM
  • 5. This is not your mama's Xamarin! • Xamarin Forms are a whole new thing • Xamarin Forms are the future!* • For now, limited but extremely powerful • A natural migraMon for XAML programmers * Personal Opinion
  • 6. What Is Xamarin? • Xamarin is a framework that allows you to create naMve iOS, Android, Windows Phone and Mac applicaMons in C#.
  • 7. What Is Xamarin Forms? • Create naMve iOS, Android, WP applicaMons (UX) with shared code • XAML and/or C#
  • 8. What Is Xamarin Studio? • An Integrated Development Environment (IDE) • Similar to Visual Studio • Runs on Mac and Windows
  • 9. Your Development Environment • OpMon 1: Mac only – Develop iOS and Android in Xamarin Studio • OpMon 2: Parallels on Mac, Business license. Develop iOS, Android and Windows Phone in Visual Studio • OpMon 3: Windows only – Develop Android and Windows Phone in Visual Studio or Xamarin Studio
  • 10. XAML • Anything you can do in XAML you can do in C#. • But don't.
  • 11. XAML and MVVM • You can do XAML without MVVM • But don't.
  • 12. MVVM From The Start • Model: Your data • View: Your presentaMon (UI) • View-­‐Model: The glue • The logic goes in the VM
  • 13. Why MVVM? • Proven paEern (WPF, Silverlight, etc.) • Especially lends itself to Xamarin Forms • Data binding • XAML • SeparaMon of concerns • Easier to maintain • Easier to test
  • 14. C# && XAML • XAML is great because • DeclaraMve • Machine-­‐readable (designer?)
  • 15. Data Binding • Rather than copying data to and from the user interface, we bind! • Bind from any object to any widget Data Source Data Control Binding
  • 16. Element Binding • You can even bind from one control to another • Example: slider to label Data Label Slider Binding
  • 17. Events • Assign event handlers • Handle in code-­‐behind • No support yet for binding events • Though there are libraries
  • 18. Demo • CreaMng your first forms applicaMon • 3 Projects • PCL • iOS • Android Demo 1 – New SoluMon
  • 19. What we're going to build • Evaluator is a mobile applicaMon • Helps you compare items such as dishwashers • You can add criteria you care about • You set how important each is
  • 20.
  • 21.
  • 22.
  • 23. Demo • First MVVM Xamarin Forms ApplicaMon • Goal: create a page that lists 3 items and their locaMon • Demo 2
  • 24. Being No:fied • How do we update the UI if the data changes? • Implement interface INoMfyPropertyChanged • Put our items in an ObservableCollecMon • Sound familiar?
  • 25. Demo • Adding noMficaMon • Demo 3
  • 26. Views and More • Pages • Layouts • Views • Cells
  • 27. Key Layouts We’ll Work With • StackLayout • GridLayout
  • 28. Key Views We’ll Work With • Label (display text) • Entry (gather text) • ListView
  • 29. Adding Views and Data • We want to add Criteria for each item • Each criterion has a name, a descripMon, an importance raMng and a raMng • Example: • Quiet • Higher values = quieter • Importance = 5 • RaMng =
  • 30. Two New Views • Details page displays the criteria for a selected item • AddCriterion allows you to add new criteria for all items
  • 31. Naviga:on • How do we go from one page to another? • How do we pass informaMon from one page to another?
  • 32. Demo • Criteria • Details Page • Demo 4
  • 33. Demo • Fixing the integers • Forms provide strings • Storing numbers as strings is undesirable • SoluMon: IValueConverter • Demo 5
  • 34. Demo • Move the “Add criterion” buEon to the details page • Add “Add Item” to Items page • Create AddItemPage • Demo 6
  • 35. Tabbed Pages • As always, write to the abstracMon • Displays appropriate to the plamorm • In the MainPage.xaml: <TabbedPage.Children> <local:ItemsPage /> <local:HelpPage /> <local:LicensePage /> </TabbedPage.Children> Declare your tabbed pages Remember to create namespace
  • 36. Demo • Create a new MainPage • Add tabbed Pages • 1st tab = Items • 2nd tab = Help • 3rd tab = License • Remember: Page type is TabbedPage • Demo 7
  • 37. Demo • Adding to toolbar • Drop/Seed DB • Demo 8
  • 38. Images • From • A file, A Uri, A Resource • Aspect • Fill, AspectFill, AspectFit • hEp://jliberty.me/dishwasherjpg
  • 39. Maps • Using Map control • Sepng locaMon • Sepng MapType
  • 40. Demo • Adding a map • Demo 9
  • 41. Custom Rendering • Remember that forms render naMvely • This is done with “Renderers” • You can write Custom Renderers
  • 42. Demo • Custom Rendering • Demo 10
  • 43. Add icons • Evaluate
  • 44.
  • 46. Contact Me • Jesse Liberty • Falafel So5ware • jesse@falafel.com • @jesseliberty