xamarin forms

33
#XamarinDevDays

Upload: rui-marinho

Post on 13-Jan-2017

52 views

Category:

Mobile


0 download

TRANSCRIPT

PowerPoint Presentation

#XamarinDevDays

Rui Marinho@ruiespinhoSoftware Engineer Xamarin FormsCross-Platform Native User Interfaceswith Xamarin.Forms

Build native UIs for iOS, Android, and Windows from a single, shared C# codebase.Meet Xamarin.Forms

Xamarin + Xamarin.FormsTraditional Xamarin ApproachWith Xamarin.Forms:More code-sharing, all native iOS C# UI Windows C# UIAndroid C# UI

Shared C# Backend

Shared UI CodeShared C# Backend

Whats included 40+ Pages, layouts, and controls (Build from code behind or XAML) Two-way data binding Navigation Animation API Dependency Service Messaging Center

Shared C# Backend

Shared UI Code

5

LayoutsPagesStackAbsoluteRelativeGridContentViewScrollViewFrame

ContentMasterDetailNavigationTabbedCarousel

Inside of a page are layoutsA lot of options from something simple like a stack panel to complex and powerful grids

6

ActivityIndicatorBoxViewButtonDatePickerEditorEntryImageLabelListViewMapOpenGLViewPickerProgressBarSearchBarSliderStepperTableViewTimePickerWebViewEntryCellImageCellSwitchCellTextCellViewCellControls

You have more than 40 controls, layouts, and pages to mix and match from.These are all of the controls you have out of the box, you can of course create your own.What is unique is you get the native control and have access to it.Consider an Entry FieldOn iOS it is mapped to UITextFieldAndroid it is EditTextWindows Phoen it is a TextBox7

Xamarin.Forms Ecosystem

WindowsXamarin.FormsStackPanelStackLayoutTextBoxEntryListBoxListViewCheckBoxSwitchProgressBarActivityIndicatorGridGridLabelLabelButtonButtonImageImageDate/TimePickerDate/TimePicker

Control Comparison

9

WindowsXamarin.FormsDataContextBindingContext{Binding Property}{Binding Property}ItemsSourceItemsSourceItemTemplateItemTemplateDataTemplateDataTemplate

BindingComparison

10

PlatformCustomization

11

Native UI from shared code

Xamarin.Forms

Demo

Start the app, create the lights page and lights view model, just binding the list and item template13

Whats new?

Xamarin.Forms 2.0!

Xamarin.Formsis Open Source!open.xamarin.com

Apple has a developer preview where Xamarin has alphas ready. Google does not offer this. Android versions are usually 4 to 8 weeks out for a stable release, but alphas and betas are usually earlier. Xamarin realizes how important having iOS ready because within 24 hours a large portion of iOS users upgradeAndroid on the other hand is much different. After 4 months on the market Android 4.4 only had 1% adoption

15

PerformancePerformancePerformance

ListView CachingStrategy

Improves scrolling performance Old behavior is currently the default (but likely to change)

XAML CompilationXAML

RuntimeCompile-timeParsed and inflatedParsed & turned into IL

XAMLC

Benefits Faster Loading Smaller App Size See XAML errors at build time

Design & Controls

Data Templates

CarouselViewEmbeddable CarouselItemTemplate & DataTemplatesHighly customizable & Virtualized

Effects I Custom renderer lite Change properties on the native control Optional stringly-typed

X No methods or eventsX No replacing the control

A unique aspect of Xamarin.Forms is an abstraction over the user interface, but what about the platform specific functionality that makes these devices so special?

That is where plugins for Xamarin come in.23

Effects IIentry.Effects.Add (Effect.Resolve("Xamarin.BorderEffect"));

A unique aspect of Xamarin.Forms is an abstraction over the user interface, but what about the platform specific functionality that makes these devices so special?

That is where plugins for Xamarin come in.24

Native Embedding

Easily embed any native control into a Xamarin.Forms layout.

Native Embedding

Just add it as child to a layout.Exposed as an Extension Method.

Xamarin.Forms

Demo Styles- Triggers Animation - Effects NativeViews with Native Bindings

GO back to the app,

Start with style. NavBar and iOS27

So much more

XAML Previewer

URL Navigation

Connect Web to MobileSimple cross platform API over:CoreSpotlightNSUserActivityGoogle App Indexing

DataPages

https://developer.xamarin.com/guides/xamarin-forms/datapages/

Themes

https://developer.xamarin.com/guides/xamarin-forms/themes/

20 Minute Break

RuiMarinhoSoftware Engineer Xamarin [email protected]/rmarinho@ruiespinho

2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.11/2/1633