Upload
michael-ridland
View
591
Download
0
Tags:
Embed Size (px)
Citation preview
[email protected] www.xam-consulting.com www.michaelridland.com
Michael Ridland
Xamarin Consultant / Founder
@ Xam Consulting (xam-consulting.com)
Xamarin Specialists - We work with Xamarin
all day and night.
[email protected] www.xam-consulting.com www.michaelridland.com
Developed Apps WITHOUT Xamarin.Forms
[email protected] www.xam-consulting.com www.michaelridland.com
Developed Apps WITH Xamarin.Forms
www.xam-consulting.com [email protected]
My experiences and tips.
[email protected] www.xam-consulting.com www.michaelridland.com
Good Parts
Fast and Easy (Generally)
good features/extensibility points - custom renderers,
message centre etc.
Anything you can do in a Native app you can do in
Xamarin.Forms
[email protected] www.xam-consulting.com www.michaelridland.com
Not Good Parts
At the moment it still stuffers from common denominator. e.g.
Save and Cancel are different on Android, iOS and WP.
The coverage of UI elements isn’t huge
Tiny Cuts - No Bordering, Padding, Radius, ToolBarButtons only
on rightside, Only TapGestureRegonizers, Picker not databound
Missing extensibility points, when tapping into Framework (unless
you do a fully custom page/viewcontroller)
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Don’t fight the Framework
‘I want Cancel here because that’s how I do it in iOS’…
‘I want swipe cell because that’s how I do it in iOS’…
If you use Xamarin.Forms, try not to bring in pre conceptions of how you
want your UI to be. You can build nice UI’s with Xamarin.Forms but you
just need to be within it’s constraints and no swipe cells.
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Don’t fight the Framework
33,000
.NET
BIG? 40,000 (Forms)4,000+
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Don’t fight the Framework
It’s 3-10 times more expensive
but you can still do anything that you can do in Native
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Style with StackLayout and BoxView
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Prototype
• Prototype your app in Xamarin.Forms.. see if it’s going to work…
• Traditional Xamarin.iOS and Xamarin.Android is still great if you want a
amazing experience on all platforms.
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - MessagingCentre
• Publish/Subscribe
• Great for communicating between different parts of app, especially
between the Forms API and Native API
• Don’t overdo it (can be abused like a goto statement)
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Device.StartTimer
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Bindable Property Code Template
public static readonly BindableProperty $Name$Property
= BindableProperty.Create<$owner$, $type$>(p => p.$Name$, default($type$));
public $type$ $Name$ {
get { return ($type$)GetValue($Name$Property); }
set { SetValue($Name$Property, value); }
}
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Use a Mvvm
Preferable one with a Convention over Configuration.
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Layer Views using AbsoluteLayout
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Easy dialogs with Acr-Xamarin-Forms
Easily add Alerts/Prompts/Loading Dialogs using Acr
(https://github.com/aritchie/acr-xamarin-forms)
- It’s in nuget
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Fill the gaps with Xamarin.Forms.Labs
What else is there?
- More UI elements
- HybridWebView can be useful when used with Razor!
- INetwork service get the InternetConnectionStatus (WIFI)?
- Photo library/take a photo
- Extended TextFields - Fonts and Border properties
- + More
www.xam-consulting.com [email protected]
Labs Demo
Warning - Don’t try labs on your first day.
Warning 2 - It can be broken and part implemented
[email protected] www.xam-consulting.com www.michaelridland.com
Tip - Use the Source
Xamarin.Forms Source (Can use Assembly browser in XS)
XLabs Source
* The #1 documentation for Custom Renderers!
www.xam-consulting.com [email protected]
Yes! (Probably)
There’s some sucky parts, but it’s still better than every other option.
Should I use Xamarin.Forms?
www.xam-consulting.com [email protected]
Tip - Hire Me ;) - www.michaelridland.com
All your pain goes away ….
www.xam-consulting.com [email protected]
Live Coding - Rolling your own Mvvm